mirror of
https://github.com/henrygd/beszel.git
synced 2026-09-21 08:57:48 +02:00
48 lines
1.6 KiB
Go
48 lines
1.6 KiB
Go
import { lazy } from "react"
|
|
import { useIntersectionObserver } from "@/lib/use-intersection-observer"
|
|
import { cn } from "@/lib/utils"
|
|
|
|
const ContainersTable = lazy(() => import("../../containers-table/containers-table"))
|
|
|
|
export function LazyContainersTable({ systemId }: { systemId: string }) {
|
|
const { isIntersecting, ref } = useIntersectionObserver({ rootMargin: "90px" })
|
|
return (
|
|
<div ref={ref} className={cn(isIntersecting && "contents")}>
|
|
{isIntersecting && <ContainersTable systemId={systemId} />}
|
|
</div>
|
|
)
|
|
}
|
|
|
|
const SmartTable = lazy(() => import("./smart-table"))
|
|
|
|
export function LazySmartTable({ systemId }: { systemId: string }) {
|
|
const { isIntersecting, ref } = useIntersectionObserver({ rootMargin: "90px" })
|
|
return (
|
|
<div ref={ref} className={cn(isIntersecting && "contents")}>
|
|
{isIntersecting && <SmartTable systemId={systemId} />}
|
|
</div>
|
|
)
|
|
}
|
|
|
|
const ZfsTable = lazy(() => import("./storage-pools-table"))
|
|
|
|
export function LazyZfsTable({ systemId }: { systemId: string }) {
|
|
const { isIntersecting, ref } = useIntersectionObserver({ rootMargin: "90px" })
|
|
return (
|
|
<div ref={ref} className={cn(isIntersecting && "contents")}>
|
|
{isIntersecting && <ZfsTable systemId={systemId} />}
|
|
</div>
|
|
)
|
|
}
|
|
|
|
const SystemdTable = lazy(() => import("../../systemd-table/systemd-table"))
|
|
|
|
export function LazySystemdTable({ systemId }: { systemId: string }) {
|
|
const { isIntersecting, ref } = useIntersectionObserver()
|
|
return (
|
|
<div ref={ref} className={cn(isIntersecting && "contents")}>
|
|
{isIntersecting && <SystemdTable systemId={systemId} />}
|
|
</div>
|
|
)
|
|
}
|