/**
 * Row showing a selected or uploading file with optional progress and errors.
 * @category Form Inputs
 * @useCases file upload list, attachment row
 * @keywords file, upload, attachment, progress, success, error
 * @related UiFileUploadBox, UiItem, UiButton, UiProgress
 */
export type UiFileItemSize = 'default' | 'small';

import type { UiFileTypeTone } from '@/components/UiFileType';

/**
 * Media badge tone. Re-exported alias of `UiFileTypeTone` (the file-type
 * badge is rendered via {@link UiFileType}). Auto-derived from the filename
 * extension when omitted; see `UiFileType` for the mapping.
 */
export type UiFileItemMediaTone = UiFileTypeTone;

export interface UiFileItemProps {
  /** Full file name. The trailing extension is hidden from the title. */
  filename: string;
  /** Short type label, e.g. `PDF`. Shown only in the success state. */
  typeLabel?: string;
  /** Size label, e.g. `1.2 MB`. Shown only in the success state. */
  sizeLabel?: string;
  /** Upload progress 0–100. Values `< 100` show a progress bar. */
  progress?: number | null;
  /** Error message. When non-empty, the row enters the error state. */
  error?: string | null;
  /** Accessible label for the remove control. */
  removeLabel?: string;
  /** Accessible label for the progress bar (i18n hook). Defaults to the `filename`. */
  progressLabel?: string;
  /**
   * When `true`, renders a close icon that emits `remove`.
   * @default true
   */
  removable?: boolean;
  /** When `true`, the row is `inert` and visually de-emphasized. */
  disabled?: boolean;
  /**
   * Visual size preset.
   * @default 'default'
   */
  size?: UiFileItemSize;
  /** Media badge tone. Auto-derived from the extension when omitted. */
  mediaTone?: UiFileItemMediaTone;
  /** Lucide icon name for the media badge. Auto-derived when omitted. */
  mediaIcon?: string;
}
