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 { AuthentikApplication } from "../api/authentik"; import type { WidgetInstance } from "../types"; interface Props { widget: WidgetInstance; refreshIntervalMs: number; description?: string; } export function AuthentikApplicationsWidget({ widget, refreshIntervalMs, description, }: Props) { const { data, isLoading } = useWidgetData(widget.id, refreshIntervalMs); const payload = data?.data as { items?: AuthentikApplication[] } | undefined; const applications = payload?.items ?? []; return ( {isLoading && !data ? ( ) : data?.error ? ( {data.error} ) : applications.length ? ( ) : (

No applications found.

)}
); }