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 { WidgetInstance } from "../types"; interface Props { widget: WidgetInstance; refreshIntervalMs: number; description?: string; } type SshTaskResult = { exit_status: number; stdout: string; stderr: string; }; export function SshTaskWidget({ widget, refreshIntervalMs, description, }: Props) { const { data, isLoading } = useWidgetData(widget.id, refreshIntervalMs); const result = data?.data as SshTaskResult | undefined; return ( {isLoading && !data ? (
) : data?.error ? ( {data.error} ) : result ? (
Exit status:{" "} {result.exit_status}
{result.stdout ? (
							{result.stdout}
						
) : null} {result.stderr ? (
							{result.stderr}
						
) : null}
) : null}
); }