import React from 'react' import { Link, usePage } from '@inertiajs/react' import StudioLayout from '../../Layouts/StudioLayout' const kpiItems = [ { key: 'views', label: 'Views', icon: 'fa-eye', color: 'text-emerald-400' }, { key: 'likes', label: 'Likes', icon: 'fa-heart', color: 'text-pink-400' }, { key: 'saves', label: 'Saves', icon: 'fa-bookmark', color: 'text-amber-400' }, { key: 'remixes', label: 'Remixes', icon: 'fa-code-branch', color: 'text-cyan-400' }, { key: 'comments', label: 'Comments', icon: 'fa-comment', color: 'text-blue-400' }, { key: 'challenge_entries', label: 'Challenges', icon: 'fa-trophy', color: 'text-violet-400' }, ] const secondaryItems = [ { key: 'favorites', label: 'Favorites', icon: 'fa-star' }, { key: 'shares', label: 'Shares', icon: 'fa-share-nodes' }, { key: 'downloads', label: 'Downloads', icon: 'fa-download' }, ] export default function StudioCardAnalytics() { const { props } = usePage() const { card, analytics } = props return ( Back to Cards
{card?.preview_url ? {card.title} : null}

{card?.title}

/{card?.slug}

{card?.status} • {card?.visibility}

{kpiItems.map((item) => (
{item.label}

{(analytics?.[item.key] ?? 0).toLocaleString()}

))}

Ranking signals

Trending score
{Number(analytics?.trending_score ?? 0).toFixed(2)}
Last engaged
{analytics?.last_engaged_at || 'No activity yet'}

Secondary metrics

{secondaryItems.map((item) => (
{item.label}
{(analytics?.[item.key] ?? 0).toLocaleString()}
))}
) }