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 { widget } = service;
const { tuner = 0 } = widget;
const { data: channelsData, error: channelsError } = useWidgetAPI(widget, "lineup");
const { data: statusData, error: statusError } = useWidgetAPI(widget, "status");
if (channelsError || statusError) {
const finalError = channelsError ?? statusError;
return ;
}
if (!channelsData || !statusData) {
return (
);
}
// Provide a default if not set in the config
if (!widget.fields) {
widget.fields = ["channels", "hd"];
}
// Limit to a maximum of 4 at a time
if (widget.fields.length > 4) {
widget.fields = widget.fields.slice(0, 4);
}
return (
channel.HD === 1)?.length} />
num.VctNumber != null).length ?? 0} / ${statusData?.length ?? 0}`}
/>
);
}