import { ArrowUpRight, ArrowDownRight, Pencil, Trash2 } from 'lucide-react'; import { cn } from '../../lib/cn'; export interface MiningItem { id: string; productName: string; badge?: { label: string; type: 'error' | 'success' | 'info' | 'warning' | 'default'; }; status?: string; potentialKgs: number; orderedKgs: number; } export interface PotentialMiningTableProps { data: MiningItem[]; onEdit?: (item: MiningItem) => void; onDelete?: (item: MiningItem) => void; hideOrderDetails?: boolean; } export function PotentialMiningTable({ data, onEdit, onDelete, hideOrderDetails }: PotentialMiningTableProps) { return (
{!hideOrderDetails && ( <> )} {(onEdit || onDelete) && ( )} {data.map((item) => { const difference = item.orderedKgs - item.potentialKgs; const isSurplus = difference >= 0; const absDiff = Math.abs(difference); return ( {!hideOrderDetails && ( <> )} {(onEdit || onDelete) && ( )} ); })}
Product Potential (Kgs)Ordered (Kgs) DifferenceActions
{item.productName} {item.badge && ( {item.badge.label} )}
{item.potentialKgs} {item.orderedKgs}
{isSurplus ? ( ) : ( )} {absDiff} Kgs
{isSurplus ? 'Surplus' : 'Shortfall'}
{onEdit && ( )} {onDelete && ( )}
); }