{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "account-integrations-01", "type": "registry:block", "description": "Third-party integrations management", "registryDependencies": [ "button", "card", "switch" ], "files": [ { "path": "creative-tim-ui/blocks/account-integrations-01/page.tsx", "content": "\"use client\"\n\nimport * as React from \"react\"\nimport {\n Check,\n ChevronDown,\n Copy,\n ExternalLink,\n Github,\n MessageCircle,\n Shield,\n} from \"lucide-react\"\n\nimport {\n Accordion,\n AccordionContent,\n AccordionItem,\n AccordionTrigger,\n} from \"@/components/ui/accordion\"\nimport { Badge } from \"@/components/ui/badge\"\nimport { Button } from \"@/components/ui/button\"\nimport { Card } from \"@/components/ui/card\"\nimport { Label } from \"@/components/ui/label\"\nimport { Switch } from \"@/components/ui/switch\"\n\nconst INTEGRATIONS = [\n {\n id: \"github\",\n name: \"GitHub\",\n icon: Github,\n category: \"Development\",\n description:\n \"Connect your GitHub account to sync repositories and track contributions.\",\n isConfigured: false,\n connectedEmail: null,\n verificationCode: null,\n },\n {\n id: \"spotify\",\n name: \"Spotify\",\n icon: MessageCircle, // Replaced Spotify icon with MessageCircle\n category: \"Music\",\n description:\n \"Link your Spotify account to share playlists and sync listening activity.\",\n isConfigured: true,\n connectedEmail: \"emma@mail.com\",\n verificationCode: \"1172913\",\n },\n {\n id: \"discord\",\n name: \"Discord\",\n icon: MessageCircle,\n category: \"Communication\",\n description:\n \"Integrate your Discord account to manage server connections and notifications.\",\n isConfigured: false,\n connectedEmail: null,\n verificationCode: null,\n },\n]\n\nexport default function AccountIntegrations01() {\n const [activeIntegrations, setActiveIntegrations] = React.useState<\n Record\n >(\n INTEGRATIONS.reduce(\n (acc, integration) => {\n acc[integration.id] = integration.isConfigured\n return acc\n },\n {} as Record\n )\n )\n const [copiedCode, setCopiedCode] = React.useState(null)\n\n const toggleIntegration = (id: string) => {\n setActiveIntegrations((prev) => ({\n ...prev,\n [id]: !prev[id],\n }))\n }\n\n const copyVerificationCode = (code: string) => {\n navigator.clipboard.writeText(code)\n setCopiedCode(code)\n setTimeout(() => setCopiedCode(null), 2000)\n }\n\n return (\n
\n \n
\n
\n
\n \n
\n
\n

\n Third-Party Integrations\n

\n

\n Manage and configure connections to external services and\n platforms\n

\n
\n
\n
\n\n \n {INTEGRATIONS.map((integration) => {\n const Icon = integration.icon\n const isActive = activeIntegrations[integration.id]\n\n return (\n \n
\n
\n
\n \n
\n
\n
\n

{integration.name}

\n \n {integration.category}\n \n
\n

\n {integration.description}\n

\n
\n
\n
\n
\n \n toggleIntegration(integration.id)\n }\n />\n \n {isActive ? \"Enabled\" : \"Enable\"}\n \n
\n \n View More\n \n
\n
\n \n {!isActive ? (\n
\n

\n You haven't added your {integration.name} account\n or you aren't authorized. Click "Connect"\n to initiate the integration process.\n

\n \n
\n ) : integration.connectedEmail ? (\n
\n \n
\n
\n

Verification Code

\n

\n Use this code to complete the integration\n

\n
\n
\n \n {integration.verificationCode}\n \n \n copyVerificationCode(\n integration.verificationCode!\n )\n }\n >\n {copiedCode === integration.verificationCode ? (\n \n ) : (\n \n )}\n {copiedCode === integration.verificationCode\n ? \"Copied\"\n : \"Copy\"}\n \n
\n
\n
\n \n
\n
\n

Connected Account

\n

\n Manage your linked {integration.name} account\n

\n
\n
\n \n {integration.connectedEmail}\n \n \n
\n
\n
\n
\n ) : null}\n
\n \n )\n })}\n
\n\n
\n
\n \n
\n

Integration Security

\n

\n Ensure you trust the applications you connect. Review and manage\n third-party access to your account regularly. You can revoke\n access at any time by disabling the integration.\n

\n
\n
\n
\n
\n
\n )\n}\n", "type": "registry:page", "target": "app/account-integrations/page.tsx" } ], "meta": { "iframeHeight": "900px", "container": "w-full bg-surface min-h-svh flex px-4 py-12 items-center md:py-20 justify-center min-w-0", "mobile": "component" }, "categories": [ "account" ] }