import { Head } from '@inertiajs/react';
import { GrowthScoreReport } from '@/components/growth-score/growth-score-report';
import type {
    ExternalCompany,
    GrowthAdviceStatus,
    GrowthAnalysis,
    SavedAdvisorAdvice,
} from '@/types/growth-score';

type Props = {
    client: ExternalCompany;
    analysis: GrowthAnalysis;
    currency: string;
    saved_advice: SavedAdvisorAdvice | null;
    advice_status: GrowthAdviceStatus;
    expires_at: string;
};

export default function SharedGrowthScore({
    client,
    analysis,
    currency,
    saved_advice,
    advice_status,
}: Props) {
    return (
        <>
            <Head title={`Growth Score · ${client.name}`} />
            <main className="min-h-screen p-4 md:p-8">
                <GrowthScoreReport
                    analysis={analysis}
                    currency={currency}
                    savedAdvice={saved_advice}
                    adviceStatus={advice_status}
                    publicView
                    subtitle={`Growth score for ${client.name}`}
                />
            </main>
        </>
    );
}
