import { InertiaLinkProps } from '@inertiajs/react';
import { LucideIcon } from 'lucide-react';
export * from './yup';

export interface Auth {
    user: User | null;
    permissions?: string[];
}

export interface BreadcrumbItem {
    title: string;
    href: string;
}

export interface NavGroup {
    title: string;
    items: NavItem[];
}
export interface User {
    id: number;
    uid: string;
    staff_id: string;
    name: string;
    email: string;
    avatar?: string;
    email_verified_at: string | null;
    role: string;
    created_at: string;
    updated_at: string;
    [key: string]: unknown;
    userSummary: [UserSummaryItem];
}

export interface BulkAction<TData> {
    confirm: boolean;
    label: string;
    icon?: LucideIcon | IconType | null;
    onClick: (selectedRows: TData[]) => void;
    className?: string; // for styling (e.g. destructive)
}
export interface nestedMenuItem {
    title: string;
    icon?: LucideIcon;
    url?: string;
    isActive?: boolean;
    items?: nestedMenuItem[];
}
export interface PaginatedData<T> {
    data: T[];
    queryParams: QueryParams;
    meta: PaginationMeta;
    links: SimplePaginationLinks;
    userSummary: [];
}
// Add missing pagination related types (were referenced implicitly by PaginatedData)
export interface PaginationMeta {
    current_page: number;
    from: number | null;
    last_page: number;
    path: string;
    per_page: number;
    to: number | null;
    total: number;
    // Allow any other meta keys Laravel might append
    [key: string]: any;
}

export interface SimplePaginationLinks {
    first?: string | null;
    last?: string | null;
    prev?: string | null;
    next?: string | null;
    // Allow standard pagination links array shape too
    [key: string]: any;
}

// Generic query params bag used across paginated pages
export interface QueryParams {
    page?: number;
    per_page?: number;
    sort_by?: string;
    sort_dir?: string;
    search?: string;
    // dynamic filter keys (role, status, date ranges, etc.)
    [key: string]: any;
}
export interface mainNavItem {
    title: string;
    icon?: LucideIcon;
    isActive?: boolean;
    /** If present => single item; if absent but `items` present => collapsible group */
    url?: string;
    items?: nestedMenuItem[];
}
export interface NavItem {
    title: string;
    href: NonNullable<InertiaLinkProps['href']>;
    icon?: LucideIcon | null;
    isActive?: boolean;
}

export interface SharedData {
    name: string;
    quote: { message: string; author: string };
    auth: Auth;
    sidebarOpen: boolean;
    translations: Record<string, string>;
    current_locale: string;
    languages: Array<{
        id: number;
        name: string;
        code: string;
        icon: string | null;
        is_default: number;
    }>;
    [key: string]: unknown;
}

export interface User {
    id: number;
    name: string;
    email: string;
    avatar?: string;
    email_verified_at: string | null;
    created_at: string;
    updated_at: string;
    uid: string;
    [key: string]: unknown; // This allows for additional properties...
}
