import { homeSiteHead } from '@frontend/content/home-page';
import { Head } from '@inertiajs/react';

export type HeadAssetsProps = {
    title?: string;
    metaKeywords?: string;
    metaDescription?: string;
};

/**
 * Per-page meta only. Template CSS and favicons load once from `frontend.blade.php`.
 */
export function HeadAssets(props: HeadAssetsProps = {}) {
    const keywords = props.metaKeywords ?? homeSiteHead.metaKeywords;
    const description = props.metaDescription ?? homeSiteHead.metaDescription;

    return (
        <Head title={props.title}>
            <meta head-key="keywords" name="keywords" content={keywords} />
            <meta head-key="description" name="description" content={description} />
        </Head>
    );
}
