import {
  type DefaultItemType,
  JoinOperator,
} from '@composed-components/ConditionLine/types';
import { segmentations } from '@src/mock/data/segmentations';

export const fieldItems = segmentations.map(seg => ({
  id: seg.id,
  name: seg.name,
}));

export const valueItems = segmentations[0].items;

export const conditionLineSlotProps = {
  joinOperatorSelector: {
    options: [
      { label: 'Y', value: JoinOperator.AND },
      { label: 'O', value: JoinOperator.OR },
    ],
  },
  conditionOperatorSelector: {
    children: 'está en',
  },
  fieldSelector: {
    title: 'Seleccionar campo',
    getTriggerTitle: (_value: DefaultItemType[]) =>
      _value[0]?.name || 'Selecciona un campo',
  },
  valueSelector: {
    title: 'Seleccionar valores',
    maxSelection: 10,
    getTriggerTitle: (_value: DefaultItemType[]) =>
      _value.map(item => item.name).join(', ') || 'Selecciona un valor',
  },
};
