diff --git a/dashboard/src/components/entity-table/table.tsx b/dashboard/src/components/entity-table/table.tsx index f6bded7..aeb7b6a 100644 --- a/dashboard/src/components/entity-table/table.tsx +++ b/dashboard/src/components/entity-table/table.tsx @@ -13,7 +13,7 @@ import { import { useTranslation } from "react-i18next" import { useEntityTableContext } from "./entity-table-provider" -import { LoaderCircle } from "lucide-react" +import { LoaderIcon } from "lucide-react" interface DataTableProps { columns: ColumnDef[] @@ -50,7 +50,7 @@ export function EntityDataTable({ {isLoading ? ( - + ) : ( diff --git a/dashboard/src/features/hosts/tables/inbound-hosts/index.tsx b/dashboard/src/features/hosts/tables/inbound-hosts/index.tsx index f37b0ca..ab436fd 100644 --- a/dashboard/src/features/hosts/tables/inbound-hosts/index.tsx +++ b/dashboard/src/features/hosts/tables/inbound-hosts/index.tsx @@ -16,7 +16,7 @@ import { InboundNotSelectedAlertDialog } from './inbound-not-selected-alert-dial export const InboundHostsTable = () => { const { data: inbounds } = useInboundsQuery() const [selectedInbound, setSelectedInbound] = useState(inbounds[0]?.id !== undefined ? String(inbounds[0].id) : undefined) - const { data } = useHostsQuery(Number(selectedInbound)) + const { data, isLoading } = useHostsQuery(Number(selectedInbound)) const [mutationDialogOpen, setMutationDialogOpen] = useDialog(); const [deleteDialogOpen, setDeleteDialogOpen] = useDialog(); @@ -79,6 +79,7 @@ export const InboundHostsTable = () => { setSelectedInbound={setSelectedInbound} onCreate={onCreate} onOpen={onOpen} + isLoading={isLoading} /> ) diff --git a/dashboard/src/features/hosts/tables/inbound-hosts/table.tsx b/dashboard/src/features/hosts/tables/inbound-hosts/table.tsx index 58aaa95..e72f570 100644 --- a/dashboard/src/features/hosts/tables/inbound-hosts/table.tsx +++ b/dashboard/src/features/hosts/tables/inbound-hosts/table.tsx @@ -34,6 +34,7 @@ import { useState } from "react" import { InboundType } from "@marzneshin/features/inbounds" import { Server } from "lucide-react" import { InboundOption } from "./inbound" +import { LoaderIcon } from "lucide-react" interface InboundHostsDataTableProps { columns: ColumnDef[] @@ -44,6 +45,7 @@ interface InboundHostsDataTableProps { setSelectedInbound: (s: string) => void onCreate?: () => void onOpen?: (object: TData) => void + isLoading: boolean } export function InboundHostsDataTable({ @@ -55,6 +57,7 @@ export function InboundHostsDataTable({ inbounds, selectedInbound, setSelectedInbound, + isLoading, }: InboundHostsDataTableProps) { const [sorting, setSorting] = useState([]) const [columnFilters, setColumnFilters] = useState([]) @@ -136,7 +139,7 @@ export function InboundHostsDataTable({ ))} - {table.getRowModel().rows?.length ? ( + {isLoading && } {!isLoading && table.getRowModel().rows?.length ? ( table.getRowModel().rows.map((row) => (