import React from "react";
import { usePresignedURL } from "../core/hooks";
import Report from "./Report";
import { Spinner, Flex, Heading, Text } from "@chakra-ui/react";
import { v4 } from "uuid";
const HOUR_KEY = "Hourly";
const DAY_KEY = "Daily";
const WEEK_KEY = "Weekly";
let timeMap = {};
timeMap[HOUR_KEY] = "hour";
timeMap[DAY_KEY] = "day";
timeMap[WEEK_KEY] = "week";
const SubscriptionReport = ({ url, id, type }) => {
const { data, isLoading } = usePresignedURL({
url: url,
isEnabled: true,
id: id,
type: type,
});
const plotMinW = "500px";
if (!data || isLoading) return ;
return (
{data?.events && Object.keys(data?.events) && (
Events
{Object.keys(data.events).map((key) => {
return (
{key}
);
})}
)}
{data?.functions && Object.keys(data?.functions) && (
functions
{Object.keys(data.functions).map((key) => {
return (
{key}
);
})}
)}
{data?.generic && Object.keys(data?.generic) && (
Account generic
{Object.keys(data.generic).map((key) => {
return (
{key}
);
})}
)}
);
};
export default SubscriptionReport;