import { Metadata } from 'next' import { requireAuth } from '@/lib/auth' import { UserRole } from '@/types/database' import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card' import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs' // Note: Charts temporarily disabled for build compatibility // import { BarChart, Bar, XAxis, YAxis, CartesianGrid, Tooltip, ResponsiveContainer, LineChart, Line, PieChart, Pie, Cell } from 'recharts' import { TrendingUp, TrendingDown, Minus } from 'lucide-react' interface StatsCardProps { title: string value: string description: string trend: 'up' | 'down' | 'neutral' } function StatsCard({ title, value, description, trend }: StatsCardProps) { const TrendIcon = trend === 'up' ? TrendingUp : trend === 'down' ? TrendingDown : Minus const trendColor = trend === 'up' ? 'text-green-500' : trend === 'down' ? 'text-red-500' : 'text-gray-500' return ( {title}
{value}

{description}

) } export const metadata: Metadata = { title: 'Analytics - United Tattoo Studio', description: 'Analytics and insights for United Tattoo Studio', } // Mock data for demonstration const monthlyBookings = [ { month: 'Jan', bookings: 45, revenue: 12500 }, { month: 'Feb', bookings: 52, revenue: 14200 }, { month: 'Mar', bookings: 48, revenue: 13800 }, { month: 'Apr', bookings: 61, revenue: 16900 }, { month: 'May', bookings: 55, revenue: 15200 }, { month: 'Jun', bookings: 67, revenue: 18500 }, ] const artistPerformance = [ { name: 'Sarah Chen', bookings: 28, revenue: 8400 }, { name: 'Marcus Rodriguez', bookings: 24, revenue: 7200 }, { name: 'Emma Thompson', bookings: 22, revenue: 6600 }, { name: 'David Kim', bookings: 19, revenue: 5700 }, ] const serviceTypes = [ { name: 'Traditional', value: 35, color: '#8884d8' }, { name: 'Realism', value: 25, color: '#82ca9d' }, { name: 'Geometric', value: 20, color: '#ffc658' }, { name: 'Watercolor', value: 12, color: '#ff7300' }, { name: 'Other', value: 8, color: '#00ff88' }, ] const COLORS = ['#8884d8', '#82ca9d', '#ffc658', '#ff7300', '#00ff88'] export default async function AnalyticsPage() { // Require admin authentication await requireAuth(UserRole.SHOP_ADMIN) return (

Analytics

Comprehensive insights and analytics for your tattoo studio

{/* Key Metrics */}
Overview Revenue Artists Services
Monthly Bookings Number of bookings over the last 6 months
{monthlyBookings.map((month) => (
{month.month} {month.bookings} bookings
))}
Service Distribution Breakdown of tattoo styles and services
{serviceTypes.map((service, index) => (
{service.name}
{service.value}%
))}
Revenue Trends Monthly revenue over the last 6 months
{monthlyBookings.map((month) => (
{month.month} ${month.revenue.toLocaleString()}
))}
Artist Performance Bookings and revenue by artist this month
{artistPerformance.map((artist) => (
{artist.name}
{artist.bookings} bookings • ${artist.revenue.toLocaleString()}
))}
Popular Services Most requested tattoo styles
{serviceTypes.map((service, index) => (
{service.name}
{service.value}%
))}
Service Trends How service preferences have changed

• Traditional tattoos remain the most popular choice

• Realism has grown 15% this quarter

• Geometric designs are trending upward

• Watercolor requests have stabilized

) }