import { redirect } from "next/navigation" import Link from "next/link" import { getArtistSession } from "@/lib/auth" import { getArtistWithPortfolio } from "@/lib/db" import { Button } from "@/components/ui/button" import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card" import { Image as ImageIcon, User, ExternalLink } from "lucide-react" async function getArtistStats(artistId: string) { const artist = await getArtistWithPortfolio(artistId) if (!artist) { return { totalImages: 0, activeImages: 0, lastUpdated: new Date() } } const totalImages = artist.portfolioImages.length const activeImages = artist.portfolioImages.filter(img => img.isPublic).length return { totalImages, activeImages, lastUpdated: artist.updatedAt } } export default async function ArtistDashboardPage() { const artistSession = await getArtistSession() if (!artistSession) { redirect("/auth/signin") } const { artist } = artistSession const stats = await getArtistStats(artist.id) return (
Manage your portfolio, update your profile, and track your presence on United Tattoo.
{stats.totalImages}
{stats.activeImages} public
{artist.isActive ? "Active" : "Inactive"}
{artist.specialties.length} specialties
{stats.lastUpdated.toLocaleDateString()}
{stats.lastUpdated.toLocaleTimeString()}
Make your profile stand out by completing these steps: