import useSWR from "swr";
import Widget from "../widget";
import Block from "../block";
import { formatApiUrl } from "utils/api-helpers";
export default function Tautulli({ service }) {
const config = service.widget;
const { data: statsData, error: statsError } = useSWR(formatApiUrl(config, "get_activity"));
if (statsError) {
return ;
}
if (!statsData) {
return (
);
}
const data = statsData.response.data;
return (
{/* We divide by 1000 here because thats how Tautulli reports it on its own dashboard */}
);
}