({ label, value, className }: Props)
| 11 | }; |
| 12 | |
| 13 | const CopyInput = ({ label, value, className }: Props) => { |
| 14 | return ( |
| 15 | <button |
| 16 | type="button" |
| 17 | className={cn('w-full min-w-0 text-left', className)} |
| 18 | onClick={() => clipboard(value)} |
| 19 | > |
| 20 | {!!label && <Label>{label}</Label>} |
| 21 | <div className="font-mono flex items-center justify-between gap-2 rounded bg-muted p-2 px-3"> |
| 22 | <span className="min-w-0 flex-1 truncate">{value}</span> |
| 23 | <CopyIcon size={16} className="shrink-0" /> |
| 24 | </div> |
| 25 | </button> |
| 26 | ); |
| 27 | }; |
| 28 | |
| 29 | export default CopyInput; |