import { useTranslation } from "next-i18next"; import Container from "components/services/widget/container"; import Block from "components/services/widget/block"; import useWidgetAPI from "utils/proxy/use-widget-api"; export default function Component({ service }) { const { t } = useTranslation(); const { widget } = service; const { data: printStats, error: printStatsError } = useWidgetAPI(widget, "print_stats"); const { data: displayStatus, error: displayStatsError } = useWidgetAPI(widget, "display_status"); const { data: webHooks, error: webHooksError } = useWidgetAPI(widget, "webhooks"); if (printStatsError || displayStatsError || webHooksError) { const finalError = printStatsError ?? displayStatsError ?? webHooksError; return ; } if (!printStats || !displayStatus || !webHooks) { return ( ); } if (webHooks.result.status.webhooks.state === "shutdown") { return ( ); } const printStatsInfo = printStats.result.status.print_stats.info ?? {}; const { current_layer: currentLayer = "-", total_layer: totalLayer = "-" } = printStatsInfo; return ( ); }