как упростить filterOptions, ток чтобы я могла использовать для другого набора колонок и их фильтров

import { MenuContent, MenuRoot, MenuTrigger } from '@/components/ui/menu'
import { Tooltip } from '@/components/ui/tooltip'
import { setSelectedTasks } from '@/store/shiftDailyTasksSlice'
import {
    Box,
    Checkbox,
    Flex,
    Icon,
    MenuItem,
    Separator,
    Table,
    Text,
    useDisclosure,
} from '@chakra-ui/react'
import React, { useRef, useState } from 'react'
import {
    RiArrowRightSLine,
    RiCheckboxMultipleBlankFill,
    RiEqualLine,
    RiFilter3Line,
} from 'react-icons/ri'
import {
    PiGreaterThanBold,
    PiGreaterThanOrEqualBold,
    PiLessThanBold,
    PiLessThanOrEqualBold,
} from 'react-icons/pi'
import { useDispatch } from 'react-redux'

const filterOptions = {
    staff: {
        operators: [
            {
                value: 'exact',
                label: 'Равно',
                icon: RiEqualLine,
                filterType: 'input',
            },
            {
                value: 'in',
                label: 'Выбрать несколько',
                icon: RiCheckboxMultipleBlankFill,
                filterType: 'checkbox',
            },
        ],
    },
    machines: {
        operators: [
            {
                value: 'exact',
                label: 'Равно',
                icon: RiEqualLine,
                filterType: 'input',
            },
            {
                value: 'in',
                label: 'Выбрать несколько',
                icon: RiCheckboxMultipleBlankFill,
                filterType: 'checkbox',
            },
        ],
    },
    time_start: {
        operators: [
            { value: 'exact', label: 'Равно', icon: RiEqualLine },
            {
                value: 'in',
                label: 'Выбрать несколько',
                icon: RiCheckboxMultipleBlankFill,
                filterType: 'checkbox',
            },
            {
                value: 'gt',
                label: 'Больше чем',
                icon: PiGreaterThanBold,
                filterType: 'input',
            },
            {
                value: 'lt',
                label: 'Меньше чем',
                icon: PiLessThanBold,
                filterType: 'input',
            },
            {
                value: 'gte',
                label: 'Больше или равно',
                icon: PiGreaterThanOrEqualBold,
                filterType: 'input',
            },
            {
                value: 'lte',
                label: 'Меньше или равно',
                icon: PiLessThanOrEqualBold,
                filterType: 'input',
            },
        ],
    },
    time_end: {
        operators: [
            {
                value: 'exact',
                label: 'Равно',
                icon: RiEqualLine,
                filterType: 'input',
            },
            {
                value: 'in',
                label: 'Выбрать несколько',
                icon: RiCheckboxMultipleBlankFill,
                filterType: 'checkbox',
            },
            {
                value: 'gt',
                label: 'Больше чем',
                icon: PiGreaterThanBold,
                filterType: 'input',
            },
            {
                value: 'lt',
                label: 'Меньше чем',
                icon: PiLessThanBold,
                filterType: 'input',
            },
            {
                value: 'gte',
                label: 'Больше или равно',
                icon: PiGreaterThanOrEqualBold,
                filterType: 'input',
            },
            {
                value: 'lte',
                label: 'Меньше или равно',
                icon: PiLessThanOrEqualBold,
                filterType: 'input',
            },
        ],
    },
    status: {
        operators: [
            {
                value: 'exact',
                label: 'Равно',
                icon: RiEqualLine,
                filterType: 'input',
            },
            {
                value: 'in',
                label: 'Выбрать несколько',
                icon: RiCheckboxMultipleBlankFill,
                filterType: 'checkbox',
            },
        ],
    },
    created_at: {
        operators: [
            {
                value: 'exact',
                label: 'Равно',
                icon: RiEqualLine,
                filterType: 'input',
            },
            {
                value: 'in',
                label: 'Выбрать несколько',
                icon: RiCheckboxMultipleBlankFill,
                filterType: 'checkbox',
            },
            {
                value: 'gt',
                label: 'Больше чем',
                icon: PiGreaterThanBold,
                filterType: 'input',
            },
            {
                value: 'lt',
                label: 'Меньше чем',
                icon: PiLessThanBold,
                filterType: 'input',
            },
            {
                value: 'gte',
                label: 'Больше или равно',
                icon: PiGreaterThanOrEqualBold,
                filterType: 'input',
            },
            {
                value: 'lte',
                label: 'Меньше или равно',
                icon: PiLessThanOrEqualBold,
                filterType: 'input',
            },
        ],
    },
}

const TableHeader = ({ column, selectedRows, allIds }) => {
    const filterMenu = useDisclosure()
    const [subMenuOpen, setSubMenuOpen] = useState()
    const dispatch = useDispatch()
    const ref = useRef(null)

    if (column.id === 'selection') {
        const allSelected = selectedRows?.length === allIds?.length
        const indeterminate = selectedRows?.length > 0 && !allSelected

        return (
            <Table.ColumnHeader
                p='0px'
                width={column.width}
                borderInlineEndWidth='0px'
                borderRight='1px solid #E8EFFA'
            >
                <Flex direction='column'>
                    <Box p='0px 8px 0px 12px'>
                        <Checkbox.Root
                            checked={
                                indeterminate ? 'indeterminate' : allSelected
                            }
                            onCheckedChange={e => {
                                if (e.checked) {
                                    dispatch(setSelectedTasks([...allIds]))
                                } else {
                                    dispatch(setSelectedTasks([]))
                                }
                            }}
                            cursor='pointer'
                        >
                            <Checkbox.HiddenInput />
                            <Checkbox.Control />
                        </Checkbox.Root>
                    </Box>
                </Flex>
            </Table.ColumnHeader>
        )
    }

    const columnFilterOptions = filterOptions[column.filterName] || null
    return (
        <Table.ColumnHeader
            color='bia.black.700'
            textStyle='bia.table'
            p='0px'
            width={column.width}
            borderInlineEndWidth='0px'
            borderRight='1px solid #E8EFFA'
        >
            <Flex direction='column'>
                <Box p='0px 8px 0px 12px'>
                    <Text>{column.Header}</Text>
                </Box>
                <Separator borderColor='bia.neutral.500' />
                <Box p='0px 8px 0px 12px'>
                    {columnFilterOptions && (
                        <MenuRoot
                            closeOnSelect={false}
                            onOpenChange={details => {
                                if (!details.open) {
                                    filterMenu.onClose()
                                    setSubMenuOpen(null)
                                }
                            }}
                            positioning={{
                                getAnchorRect() {
                                    return ref.current
                                        ? ref.current.getBoundingClientRect()
                                        : null
                                },
                            }}
                            open={filterMenu.open}
                            variant='bia.filterMenu'
                        >
                            <Tooltip
                                content={'Фильтры'}
                                openDelay={0}
                            >
                                <MenuTrigger
                                    w='24px'
                                    h='24px'
                                    borderRadius='4px'
                                    border='2px solid transparent'
                                    _focusVisible={{
                                        outline: '2px solid #FFCCD2',
                                        outlineOffset: '0',
                                    }}
                                    onClick={filterMenu.onOpen}
                                    variant='outline'
                                    ref={ref}
                                >
                                    <Icon
                                        as={RiFilter3Line}
                                        width='20px'
                                        height='20px'
                                        fill={
                                            filterMenu.open
                                                ? 'bia.red.800'
                                                : 'bia.black.800'
                                        }
                                    />
                                </MenuTrigger>
                            </Tooltip>
                            <MenuContent p='0'>
                                <Flex direction='column'>
                                    {columnFilterOptions.operators.map(
                                        filter => (
                                            <MenuItem
                                                key={filter.value}
                                                justifyContent='space-between'
                                            >
                                                <Flex
                                                    alignItems='center'
                                                    gap='8px'
                                                >
                                                    <Icon
                                                        width='20px'
                                                        height='20px'
                                                        color='#2B2D35'
                                                        as={filter.icon}
                                                    />
                                                    <Text
                                                        fontSize='14px'
                                                        lineHeight='24px'
                                                    >
                                                        {filter.label}
                                                    </Text>
                                                </Flex>
                                                <Icon
                                                    width='20px'
                                                    height='20px'
                                                    color='#2B2D35'
                                                    as={RiArrowRightSLine}
                                                />
                                            </MenuItem>
                                        )
                                    )}
                                </Flex>
                            </MenuContent>
                        </MenuRoot>
                    )}
                </Box>
            </Flex>
        </Table.ColumnHeader>
    )
}

export default TableHeader