
import type { NcSource } from '@/lib/api/types/previous-nc.types';

export interface EditableEntry {
  id: number;
  nc_type: string;
  ncr_statement: string;
  criteria_clause: string;
  corrective_action: string;
  status: 'open' | 'closed' | 'pending';
  document_path: string | null;
  _dirty: boolean;
}
 
export type { NcSource };
export function isDraft(entry: EditableEntry): boolean {
  return entry.id < 0;
}
 
export interface FindingViewProps {
  entry: EditableEntry;
  index: number;
  expanded: boolean;
  source: NcSource;
  ncId: number;
  onToggleExpand: () => void;
  onChange: (patch: Partial<EditableEntry>) => void;
  onFileChanged: (newPath: string | null) => void;
  onDelete: () => void;
}
