import type { FilterDefinition } from '@/components/shared/filter-bar';
import { BERTH_AREAS, BERTH_STATUSES, toSelectOptions } from '@/lib/constants';

export const berthFilterDefinitions: FilterDefinition[] = [
  {
    key: 'search',
    label: 'Search',
    type: 'text',
    placeholder: 'Search mooring number or area...',
  },
  {
    key: 'status',
    label: 'Status',
    type: 'multi-select',
    options: BERTH_STATUSES.map((s) => ({
      value: s,
      label: s === 'available' ? 'Available' : s === 'under_offer' ? 'Under Offer' : 'Sold',
    })),
  },
  {
    key: 'area',
    label: 'Dock',
    type: 'select',
    options: toSelectOptions(BERTH_AREAS),
  },
  {
    key: 'tenureType',
    label: 'Tenure Type',
    type: 'select',
    options: [
      { value: 'permanent', label: 'Permanent' },
      { value: 'fixed_term', label: 'Fixed Term' },
    ],
  },
  {
    key: 'tagIds',
    label: 'Tags',
    type: 'multi-select',
    options: [], // populated dynamically via TagPicker in the list component
  },
];
