import React from 'react' import { usePage, Link } from '@inertiajs/react' import StudioLayout from '../../Layouts/StudioLayout' const kpiConfig = [ { key: 'total_artworks', label: 'Total Artworks', icon: 'fa-images', color: 'text-blue-400', link: '/studio/artworks' }, { key: 'views_30d', label: 'Views (30d)', icon: 'fa-eye', color: 'text-emerald-400', link: null }, { key: 'favourites_30d', label: 'Favourites (30d)', icon: 'fa-heart', color: 'text-pink-400', link: null }, { key: 'shares_30d', label: 'Shares (30d)', icon: 'fa-share-nodes', color: 'text-amber-400', link: null }, { key: 'followers', label: 'Followers', icon: 'fa-user-group', color: 'text-purple-400', link: null }, ] function KpiCard({ config, value }) { const content = (
{config.label}

{typeof value === 'number' ? value.toLocaleString() : value}

) if (config.link) { return {content} } return content } function TopPerformerCard({ artwork }) { return (
{artwork.thumb_url && ( {artwork.title} )}

{artwork.title}

❤️ {artwork.favourites?.toLocaleString()} 🔗 {artwork.shares?.toLocaleString()}
{artwork.heat_score > 5 && ( Rising )}
) } function RecentComment({ comment }) { return (

{comment.author_name} {' '}on{' '} {comment.artwork_title}

{comment.body}

{new Date(comment.created_at).toLocaleDateString()}

) } export default function StudioDashboard() { const { props } = usePage() const { kpis, topPerformers, recentComments } = props return ( {/* KPI Cards */}
{kpiConfig.map((config) => ( ))}
{/* Top Performers */}

Your Top Performers

Last 7 days
{topPerformers?.length > 0 ? (
{topPerformers.map((art) => ( ))}
) : (

No artworks yet. Upload your first creation!

Upload
)}
{/* Recent Comments */}

Recent Comments

{recentComments?.length > 0 ? ( recentComments.map((c) => ) ) : (

No comments yet

)}
) }