()
| 6 | import { CheckIcon, CopyIcon } from "lucide-react"; |
| 7 | |
| 8 | export const ProjectCopy = () => { |
| 9 | const { project, isLoading } = useCurrentProject(); |
| 10 | const [clicked, setClicked] = useState(false); |
| 11 | |
| 12 | if (isLoading) return null; |
| 13 | |
| 14 | return ( |
| 15 | <Button |
| 16 | size="sm" |
| 17 | variant="outline" |
| 18 | onClick={() => { |
| 19 | copyToClipboard(project.id); |
| 20 | setClicked(true); |
| 21 | trackEvent("project_id_copied", { projectId: project.id }); |
| 22 | |
| 23 | setTimeout(() => { |
| 24 | setClicked(false); |
| 25 | }, 3000); |
| 26 | }} |
| 27 | > |
| 28 | {clicked ? ( |
| 29 | <> |
| 30 | <CheckIcon className="mr-2 h-4 w-4" /> |
| 31 | Copied! |
| 32 | </> |
| 33 | ) : ( |
| 34 | <> |
| 35 | <CopyIcon className="mr-2 h-4 w-4" /> |
| 36 | Copy Project ID |
| 37 | </> |
| 38 | )} |
| 39 | </Button> |
| 40 | ); |
| 41 | }; |
nothing calls this directly
no test coverage detected