import { Box, Table, Thead, Tbody, Th, Td, Tr, HStack } from '@chakra-ui/react'; import classNames from 'classnames'; import { InboundCard } from 'components/inbounds-card'; import { handleSort } from 'components/table'; import { FC } from 'react'; import { useTranslation } from 'react-i18next'; import { useEffect } from 'react'; import { useInbounds } from 'stores'; import { InboundType } from 'types'; type InboundsSidebarProps = { inbounds: InboundType[]; } export const InboundsSidebar: FC = ({ inbounds, }) => { const { onInboundsFilterChange, inboundsFilters: filters, selectedInbound, selectInbound, refetchHosts, } = useInbounds(); useEffect(() => { selectedInbound === undefined && selectInbound(inbounds[0]); }, [selectedInbound, inbounds]); const { t } = useTranslation(); return ( {inbounds?.map((inbound, i) => { const active = inbounds[i] == selectedInbound return ( { selectInbound(inbound); refetchHosts(); }}> ); })}
{t('inbounds')}
) }