import React from 'react';
import type { InventoryStatus } from '../../hooks/useInventory';

const CONFIG: Record<InventoryStatus, { label: string; cls: string }> = {
  in_stock:     { label: 'موجود',       cls: 'in-stock' },
  low_stock:    { label: 'کم موجود',    cls: 'low-stock' },
  out_of_stock: { label: 'اتمام یافته', cls: 'out-of-stock' },
};

/** Colored availability pill — colors mirror the tauri InventoryStatus component. */
export default function InventoryStatusBadge({ status }: { status: InventoryStatus }) {
  const c = CONFIG[status] ?? CONFIG.out_of_stock;
  return <span className={`inv-badge ${c.cls}`}>{c.label}</span>;
}
