import { useState, useEffect } from "react"; import { Card, CardHeader, CardTitle, CardDescription, CardContent } from "@/components/ui/card"; import { Badge } from "@/components/ui/badge"; import { Loader2 } from "lucide-react"; export const LinkedAccounts = () => { const [gitStatus, setGitStatus] = useState(false); const [isLoading, setIsLoading] = useState(false); const [isAdmin, setIsAdmin] = useState(false); const [error, setError] = useState(null); useEffect(() => { const fetchGitStatus = async () => { setIsLoading(true); try { const response = await fetch("/api/git/user") const data = await response.json() if (!response.ok) { if (data.error) { throw new Error(data.error) } else { throw new Error(`HTTP error: ${response.status}`) } } if (data.is_admin) { setIsAdmin(true) } if (!data.message) { setGitStatus(true) } } catch (err: unknown) { if (err instanceof Error) { setError(err.message) } } finally { setIsLoading(false) } }; fetchGitStatus().then(r => r) }, []); return ( Linked Accounts LibreCloud-connected services
  • {isLoading ? ( ) : ( )} {isAdmin ? (
    LibreCloud Git Admin
    ) : ( LibreCloud Git )}
  • p0ntus mail
{error &&

{error}

}
); };