import { CheckIcon, CopyIcon, EyeIcon } from "lucide-react"; import { useEffect, useState } from "react"; import { AppStoreApp } from "src/components/connections/SuggestedAppData"; import Loading from "src/components/Loading"; import QRCode from "src/components/QRCode"; import { Badge } from "src/components/ui/badge"; import { Button } from "src/components/ui/button"; import { Card, CardContent, CardHeader, CardTitle, } from "src/components/ui/card"; import { LinkButton } from "src/components/ui/custom/link-button"; import { copyToClipboard } from "src/lib/clipboard"; import { cn } from "src/lib/utils"; import { App } from "src/types"; export function ConnectAppCard({ app, pairingUri, appStoreApp, }: { app: App; pairingUri: string; appStoreApp?: AppStoreApp; }) { const [timeout, setTimeout] = useState(false); const [isQRCodeVisible, setIsQRCodeVisible] = useState(false); const copy = () => { copyToClipboard(pairingUri); }; useEffect(() => { const timeoutId = window.setTimeout(() => { setTimeout(true); }, 30000); return () => window.clearTimeout(timeoutId); }, []); return ( Connection Secret {!app.lastUsedAt ? ( <>

Waiting for app to connect

{timeout && (
Connecting is taking longer than usual. Continue anyway
)} ) : ( App connected )} {!appStoreApp?.hideConnectionQr && (
setIsQRCodeVisible(true)} > {appStoreApp && ( )}
{!isQRCodeVisible && ( )}
)}
{/* For now not showing open in-app, only works well on Android, not on Desktop or iOS */} {/* Open In App */}
); }