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 (
{/* Welcome Section */}

Welcome to Your Dashboard

Manage your portfolio, update your profile, and track your presence on United Tattoo.

{/* Stats Grid */}
Portfolio Images

{stats.totalImages}

{stats.activeImages} public

Profile Status

{artist.isActive ? "Active" : "Inactive"}

{artist.specialties.length} specialties

Last Updated

{stats.lastUpdated.toLocaleDateString()}

{stats.lastUpdated.toLocaleTimeString()}

{/* Quick Actions */}

Quick Actions

Upload New Work Add images to your portfolio Update Profile Edit your bio and specialties View Public Profile See how your profile appears to clients Coming Soon View analytics and booking requests
{/* Profile Completion */} {(!artist.bio || artist.specialties.length === 0 || stats.totalImages === 0) && (

Complete Your Profile

Make your profile stand out by completing these steps:

)}
) }