import { Alert, AlertDescription } from "@/components/ui/alert"; import { Skeleton } from "@/components/ui/skeleton"; import { SectionCard } from "../components/SectionCard"; import { useWidgetData } from "../hooks/useWidgets"; import type { AuthentikGroup } from "../api/authentik"; import type { WidgetInstance } from "../types"; interface Props { widget: WidgetInstance; refreshIntervalMs: number; description?: string; } export function AuthentikGroupsWidget({ widget, refreshIntervalMs, description, }: Props) { const { data, isLoading } = useWidgetData(widget.id, refreshIntervalMs); const payload = data?.data as { items?: AuthentikGroup[] } | undefined; const groups = payload?.items ?? []; return ( {isLoading && !data ? ( ) : data?.error ? ( {data.error} ) : groups.length ? ( ) : (

No groups found.

)}
); }