import { InertiaLinkProps } from '@inertiajs/vue3';
import type { LucideIcon } from 'lucide-vue-next';

export interface Auth {
    user: User;
}

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

export interface NavItem {
    title: string;
    href: NonNullable<InertiaLinkProps['href']>;
    icon?: LucideIcon;
    isActive?: boolean;
}

export type AppPageProps<
    T extends Record<string, unknown> = Record<string, unknown>,
> = T & {
    name: string;
    quote: { message: string; author: string };
    auth: Auth;
    sidebarOpen: boolean;
};

export interface StatusHistory {
    from_status: 'Internship' | 'Probation' | 'Permanent' | null;
    to_status: 'Internship' | 'Probation' | 'Permanent';
    changed_at: string;
    notes?: string;
}

export interface User {
    id: number;
    emp_no?: string;
    name: string;
    father_name?: string;
    email: string;
    contact_number?: string;
    cnic?: string;
    address?: string;
    emergency_contact?: string;
    blood_group?: string;
    vehicle_type?: 'Car' | 'Bike';
    vehicle_number?: string;
    eobi_number?: string;
    salary?: number;
    joining_date?: string;
    status?: 'Internship' | 'Probation' | 'Permanent';
    status_end_date?: string;
    status_days_remaining?: number;
    increment_date?: string;
    days_until_increment?: number;
    status_histories?: StatusHistory[];
    avatar?: string;
    email_verified_at: string | null;
    created_at: string;
    updated_at: string;
    role?: string;
    role_id?: number;
}

export interface AttendanceBatch {
    id: number;
    original_filename: string;
    status: 'pending' | 'processing' | 'completed' | 'failed';
    total_rows: number;
    successful_imports: number;
    failed_imports: number;
    uploaded_by: string;
    created_at: string;
}

export interface PaginatedData<T = any> {
    data: T[];
    current_page: number;
    last_page: number;
    per_page: number;
    total: number;
    links: Array<{
        url: string | null;
        label: string;
        active: boolean;
    }>;
}

export interface QueryParams {
    search?: string;
    sort_by?: string;
    sort_direction?: 'asc' | 'desc';
    per_page?: number;
}

export interface DataTableColumn {
    key: string;
    label: string;
    sortable?: boolean;
    align?: 'left' | 'center' | 'right';
}

export type BreadcrumbItemType = BreadcrumbItem;
