import type { TableConfig } from '../../components/GenericTable'; import { TableTag } from '../../components/TableTag/TableTag'; import { TAG_PRESETS } from '../../components/TableTag/presets'; import type { ICatalogueJur } from '../../types/catalogueJur/catalogueJur'; export const catalogueJurConfig: TableConfig = { rowKey: 'id', searchableKeys: ['closed', 'inn', 'kpp', 'name', 'entity_type'], columns: [ { key: 'closed', title: 'Статус', features: { sort: true }, render: (_: unknown, row) => { // #TODO поменять логику если запись не активна return ; }, }, { key: 'inn', title: 'ИНН', features: { search: true }, }, { key: 'kpp', title: 'КПП', features: { search: true }, }, { key: 'name', title: 'Организация', features: { search: true, multiselect: true, sort: true }, }, { key: 'entity_type', title: 'Тип', features: { multiselect: true, sort: true }, render: (val) => { const preset = val === 'ЮЛ' ? TAG_PRESETS.orange : TAG_PRESETS.purple; return ; }, }, { key: 'regional_office', title: 'Основной РФ', render: (val) => (val as ICatalogueJur['regional_office'] | null)?.name, }, ], };