import { Config } from 'ziggy-js';

export interface User {
    id: number;
    name: string;
    email: string;
    email_verified_at?: string;
    is_admin?: boolean;
}

export interface ContactChannel {
    label: string;
    note: string;
    phone: string;
    display: string;
}

export interface CompanyAddress {
    label: string;
    lines: string;
}

export interface Company {
    name: string;
    short_name: string;
    site: string;
    url: string;
    tagline: string;
    homepage_title: string;
    hero: { headline: string; subhead: string };
    contacts: ContactChannel[];
    addresses: CompanyAddress[];
    emails: string[];
    tax: { gstin: string; trade_name: string };
    about: {
        founded: number;
        initiation: string;
        mission: string;
        offering: string;
        future: string;
    };
    footer_blurb: string;
    footer_note: string;
}

export interface Subcategory {
    id: number;
    category_id: number;
    name: string;
    slug: string;
    description?: string | null;
    services?: Service[];
}

export interface Category {
    id: number;
    name: string;
    slug: string;
    tagline?: string | null;
    description?: string | null;
    icon?: string | null;
    accent?: string | null;
    sort_order?: number;
    subcategories?: Subcategory[];
    services?: Service[];
    services_count?: number;
}

export interface Service {
    id: number;
    category_id: number;
    subcategory_id?: number | null;
    name: string;
    slug: string;
    summary?: string | null;
    description?: string | null;
    price_note?: string | null;
    featured?: boolean;
    category?: Category;
    subcategory?: Subcategory | null;
}

export interface StaticPage {
    id: number;
    slug: string;
    title: string;
    hero_title?: string | null;
    eyebrow?: string | null;
    summary?: string | null;
    body?: string | null;
    in_footer?: boolean;
}

export interface NavLink {
    slug: string;
    title: string;
}

export type PageProps<
    T extends Record<string, unknown> = Record<string, unknown>,
> = T & {
    auth: { user: User };
    company: Company;
    nav: Category[];
    footerPages: NavLink[];
    flash: { success: string | null; error: string | null };
    ziggy: Config & { location: string };
};
