import { HostType, HostsDeleteConfirmationDialog, HostsMutationDialog, useHostsQuery } from '@marzneshin/features/hosts' import { InboundHostsDataTable } from './table' import { useState } from 'react' import { useInboundsQuery } from '@marzneshin/features/inbounds' import { columns } from './columns' import { HostSettingsDialog } from '../../dialogs/settings' export const InboundHostsTable = () => { const { data: inbounds } = useInboundsQuery() const [selectedInbound, setSelectedInbound] = useState(String(inbounds[0]?.id)) const { data } = useHostsQuery(Number(selectedInbound)) const [mutationDialogOpen, setMutationDialogOpen] = useState(false); const [deleteDialogOpen, setDeleteDialogOpen] = useState(false); const [settingsDialogOpen, setSettingsDialogOpen] = useState(false); const [selectedEntity, selectEntity] = useState(null); const onEdit = (entity: HostType) => { selectEntity(entity); setMutationDialogOpen(true); }; const onDelete = (entity: HostType) => { selectEntity(entity); setDeleteDialogOpen(true); }; const onCreate = () => { selectEntity(null); setMutationDialogOpen(true); }; const onOpen = (entity: HostType) => { selectEntity(entity); setSettingsDialogOpen(true); }; return (
) }