import React from 'react' import { router, usePage } from '@inertiajs/react' import StudioLayout from '../../Layouts/StudioLayout' import { studioSurface, trackStudioEvent } from '../../utils/studioEvents' const rangeOptions = [7, 14, 30, 60, 90] const summaryCards = [ ['followers', 'Followers', 'fa-user-group'], ['published_in_range', 'Published', 'fa-calendar-check'], ['engagement_actions', 'Engagement actions', 'fa-bolt'], ['profile_completion', 'Profile completion', 'fa-id-card'], ['challenge_entries', 'Challenge entries', 'fa-trophy'], ['featured_modules', 'Featured modules', 'fa-star'], ] function formatShortDate(value) { const date = new Date(value) if (Number.isNaN(date.getTime())) return value return date.toLocaleDateString(undefined, { month: 'short', day: 'numeric' }) } function TrendBars({ title, subtitle, points, colorClass }) { const values = (points || []).map((point) => Number(point.value || point.count || 0)) const maxValue = Math.max(...values, 1) return (

{title}

{subtitle}

{(points || []).map((point) => { const value = Number(point.value || point.count || 0) const height = `${Math.max(8, Math.round((value / maxValue) * 100))}%` return (
{value.toLocaleString()}
{formatShortDate(point.date)}
) })}
) } export default function StudioGrowth() { const { props } = usePage() const { summary, moduleFocus, checkpoints, opportunities, milestones, momentum, topContent, rangeDays } = props const updateRange = (days) => { trackStudioEvent('studio_filter_used', { surface: studioSurface(), module: 'growth', meta: { range_days: days, }, }) router.get(window.location.pathname, { range_days: days }, { preserveScroll: true, preserveState: true, replace: true, }) } return (

Growth window

Creator growth over the last {rangeDays || 30} days

This view blends audience momentum, profile readiness, featured curation, and challenge participation into one operating surface.

{rangeOptions.map((days) => ( ))}
{summaryCards.map(([key, label, icon]) => (
{label}
{Number(summary?.[key] || 0).toLocaleString()}
))}

Growth checkpoints

{(checkpoints || []).map((item) => (
{item.label}

{item.detail}

{item.score}
{item.status.replace('_', ' ')}
))}

Growth opportunities

Module focus

Share of workspace output

Milestones

{(milestones || []).map((item) => (
{item.label}
{item.current.toLocaleString()} of {item.target.toLocaleString()}
{item.progress}%
))}
) }