"use client" import Image from "next/image" import Link from "next/link" import { useEffect, useState } from "react" import { Mail, GitBranch, Music, Key, CheckCircle, XCircle, User, LayoutDashboard, Settings, Briefcase, Loader } from "lucide-react" import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card" import { Progress } from "@/components/ui/progress" import { Sidebar, SidebarContent, SidebarFooter, SidebarHeader, SidebarMenu, SidebarMenuButton, SidebarMenuItem, SidebarProvider } from "@/components/ui/sidebar" import { motion } from "framer-motion" import { getCookie } from "cookies-next" const fadeIn = { initial: { opacity: 0, y: 20 }, animate: { opacity: 1, y: 0 }, transition: { duration: 0.4 }, } export default function Dashboard() { const [diskUsage, setDiskUsage] = useState(0) const [isGitLinked, setIsGitLinked] = useState(false) const [gitUser, setGitUser] = useState("Unlinked") const [gitFollowerCt, setGitFollowerCt] = useState(0) const [gitAvatar, setGitAvatar] = useState(null) const [gitProfileCardLoading, setGitProfileCardLoading] = useState(true) const [gitProfileCardError, setGitProfileCardError] = useState(false) useEffect(() => { const checkGitLinkStatus = async () => { try { const key = getCookie("key") const email = getCookie("email") const response = await fetch("http://localhost:3001/account/links", { method: "POST", headers: { "Content-Type": "application/json", }, body: JSON.stringify({ key, email, exi: true }), }) if (response.ok) { const data = await response.json() setIsGitLinked(data.linked || false) setGitUser(data.user || "Unlinked") setGitAvatar(data.avatar || null) setGitFollowerCt(data.followers || 0) setGitProfileCardLoading(false) } else { setGitProfileCardError(true) console.error("Failed to fetch Git link status") } } catch (error) { setGitProfileCardError(true) console.error("Error checking Git link status:", error) } } checkGitLinkStatus() }, []) return (
username
Dashboard Services My Account Settings

Dashboard

Disk Usage

{diskUsage}% of 100GB used

Account Security
Spam Protection
Two-Factor Authentication
Linked Accounts
p0ntus mail
LibreCloud Git
Services
Mail
Git
Music
Vaultwarden
LibreCloud Git
{gitProfileCardLoading ? (
) : gitAvatar ? ( User Avatar ) : gitProfileCardError ? ( ) : ( )}

{gitUser}

{gitFollowerCt} {gitFollowerCt === 1 ? "follower" : "followers"}

) }