export type BlockType = 'card' | 'button' | 'divider' | 'spacer' | 'image';

export type CardType = 'default' | 'success' | 'info' | 'warning' | 'hero' | 'basic';

export type ButtonStyle = 'solid' | 'outline' | 'link';

export type ContentWidth = 'fit' | 'full' | 'custom';

export type ContentAlign = 'left' | 'center' | 'right';

export interface BaseBlock {
  id: string;
  type: BlockType;
}

export interface CardBlock extends BaseBlock {
  type: 'card';
  cardType: CardType;
  content: string;
  bg?: string;
}

export interface ButtonBlock extends BaseBlock {
  type: 'button';
  text: string;
  link: string;
  style: ButtonStyle;
  widthMode?: ContentWidth;
  customMaxWidth?: number;
  align?: ContentAlign;
}

export interface ImageBlock extends BaseBlock {
  type: 'image';
  src: string;
  alt?: string;
  widthMode: ContentWidth;
  customMaxWidth?: number;
  align: ContentAlign;
}

export interface DividerBlock extends BaseBlock {
  type: 'divider';
}

export interface SpacerBlock extends BaseBlock {
  type: 'spacer';
  height: number;
}

export type EmailBlock =
  | CardBlock
  | ButtonBlock
  | DividerBlock
  | SpacerBlock
  | ImageBlock;

export interface EmailTemplate {
  blocks: EmailBlock[];
}
