import { useTranslation } from "next-i18next/pages"; import Block from "components/services/widget/block"; import Container from "components/services/widget/container"; import useWidgetAPI from "utils/proxy/use-widget-api"; function StreamEntry({ title, clients, bitrate }) { return (
{title} - Clients: {clients}
{bitrate}
); } export default function Component({ service }) { const { t } = useTranslation(); const { widget } = service; const { data: channels, error: channelsError } = useWidgetAPI(widget, "channels"); const { data: streams, error: streamsError } = useWidgetAPI(widget, "streams"); if (channelsError || streamsError) { return ; } if (!channels || !streams) { return ( ); } return ( <> {widget?.enableActiveStreams && streams?.channels && streams.channels.map((activeStream) => ( ))} ); }