import { Button, ResizableHandle, ResizablePanel, ResizablePanelGroup, HStack } from "@marzneshin/common/components"; import { Table } from "@tanstack/react-table" import { DataTableViewOptions } from "./components"; import { Server } from "lucide-react"; import { EntityTableContext, SidebarEntityTableContext } from "./contexts"; import { SidebarEntityCardSectionsProps, TableSearch, DataTablePagination, EntityDataTable, SidebarEntityTablePopover, SidebarEntitySelection } from "./components"; import { useSidebarEntityTable, EntitySidebarQueryKeyType, FetchEntityReturn, UseRowSelectionReturn, } from "./hooks"; import { useTranslation } from "react-i18next"; interface SidebarEntityTableProps { fetchEntity: ({ queryKey }: EntitySidebarQueryKeyType) => FetchEntityReturn; sidebarEntities: S[]; setSidebarEntityId: (entity: string | undefined) => void; sidebarEntityId?: string; sidebarCardProps: SidebarEntityCardSectionsProps; secondaryEntityKey: string; columnsFn: any; filteredColumn: string; entityKey: string; rowSelection?: UseRowSelectionReturn; manualSorting?: boolean; onCreate: () => void; onEdit: (entity: T) => void; onOpen: (entity: T) => void; onDelete: (entity: T) => void; } function MainTable({ table, columns, props }: { table: Table, columns: any, props: SidebarEntityTableProps }) { return
; } export function SidebarEntityTable(props: SidebarEntityTableProps) { const { t } = useTranslation(); const { desktop, table, entityTableContextValue, sidebarEntityTableContextValue, columns, onCreate } = useSidebarEntityTable(props); return (
{!desktop && ( {t("inbounds")} } /> )} {onCreate && ( )}
{desktop ? ( ) : ( )}
); }