export type ModalPosition = {
    x: number;
    y: number;
    width: string;
    height: string;
};

export type ModalType = 'table' | 'default';

export type ModalId = string;

export interface Modal {
    id: ModalId;
    type: ModalType;
    position: ModalPosition;
    style?: {
        backgroundColor?: string;
    };
    content?: unknown;
}

export interface ModalConfig {
    id: ModalId;
    type: ModalType;
    position: ModalPosition;
    content: unknown;
    style?: {
        backgroundColor?: string;
        borderRadius?: string;
        padding?: string;
    };
}

export type ModalAction =
    | { type: 'CREATE_MODAL'; payload: Omit<ModalConfig, 'id'> }
    | { type: 'UPDATE_MODAL'; payload: { id: ModalId } & Partial<ModalConfig> }
    | { type: 'DELETE_MODAL'; payload: { id: ModalId } }
    | { type: 'UPDATE_POSITION'; payload: { id: ModalId; position: Partial<ModalPosition> } }
    | { type: 'UPDATE_STYLE'; payload: { id: ModalId; style: Partial<ModalConfig['style']> } };

export interface ModalState {
    modals: Record<ModalId, ModalConfig>;
    activeModal: ModalId | null;
} 