import type { ReactNode } from 'react';
import type { PreviewerFormat } from '../../previewer/types';

export type EvidenceAttachmentKind =
  | 'image'
  | 'markdown'
  | 'code'
  | 'text'
  | 'json'
  | 'preview'
  | 'video'
  | 'audio'
  | 'pdf'
  | 'empty';

export type EvidenceAttachmentItem = {
  key: string;
  kind: EvidenceAttachmentKind;
  title: ReactNode;
  description?: ReactNode;
  value: string;
  linkUrl?: string;
  language?: string;
  format?: PreviewerFormat;
  copyValue?: string;
};

export type EvidenceAttachmentActionHandler = (
  attachment: EvidenceAttachmentItem,
) => void | Promise<void>;

export type EvidenceAttachmentPreviewBodyProps = {
  attachment: EvidenceAttachmentItem;
  compact?: boolean;
  height?: number | string;
};

export type EvidenceAttachmentStripProps = {
  attachments: EvidenceAttachmentItem[];
  onPreview?: EvidenceAttachmentActionHandler;
  onCopy?: EvidenceAttachmentActionHandler;
  maxVisible?: number;
  compact?: boolean;
  emptyText?: ReactNode;
  title?: ReactNode;
  description?: ReactNode;
  className?: string;
  previewBodyHeight?: number | string;
};
