import {LucideIcon} from 'lucide-react';

export type CharacterCategory = 'main' | 'secondary' | 'recurring' | 'none';
export type CharacterStatus = 'alive' | 'dead' | 'unknown';
export type CharacterAttributeSection =
    'physical'
    | 'psychological'
    | 'relations'
    | 'skills'
    | 'weaknesses'
    | 'strengths'
    | 'goals'
    | 'motivations'
    | 'arc'
    | 'secrets'
    | 'fears'
    | 'flaws'
    | 'beliefs'
    | 'conflicts'
    | 'quotes'
    | 'distinguishingMarks'
    | 'items'
    | 'affiliations';

export function isCharacterCategory(value: string): value is CharacterCategory {
    return value === 'main' || value === 'secondary' || value === 'recurring' || value === 'none';
}

export function isCharacterStatus(value: string): value is CharacterStatus {
    return value === 'alive' || value === 'dead' || value === 'unknown';
}

export interface Relation {
    name: string;
    type: string;
    description: string;
    history: string;
}

export interface Attribute {
    id: string;
    name: string;
}

export interface CharacterAttribute {
    [key: string]: Array<Attribute>;
}

export interface CharacterProps {
    id: string | null;
    name: string;
    lastName: string;
    nickname: string;
    age: number | null;
    gender: string;
    species: string;
    nationality: string;
    status: CharacterStatus;
    category: CharacterCategory;
    title: string;
    image: string;
    physical: Attribute[];
    psychological: Attribute[];
    relations: Attribute[];
    skills: Attribute[];
    weaknesses: Attribute[];
    strengths: Attribute[];
    goals: Attribute[];
    motivations: Attribute[];
    arc: Attribute[];
    secrets: Attribute[];
    fears: Attribute[];
    flaws: Attribute[];
    beliefs: Attribute[];
    conflicts: Attribute[];
    quotes: Attribute[];
    distinguishingMarks: Attribute[];
    items: Attribute[];
    affiliations: Attribute[];
    role: string;
    biography?: string;
    history?: string;
    speechPattern?: string;
    catchphrase?: string;
    residence?: string;
    notes?: string;
    color?: string;
    seriesCharacterId?: string | null;
}

export interface CharacterListResponse {
    characters: CharacterProps[];
    enabled: boolean;
}

export interface CharacterElement {
    title: string;
    section: CharacterAttributeSection;
    placeholder: string;
    icon: LucideIcon;
}

export interface AttributeResponse {
    attributes: Attribute[];
}
