bananas-commerce-admin
Version:
What's this, an admin for apes?
20 lines • 1.17 kB
JavaScript
import React from "react";
import { Stack, Typography } from "@mui/material";
import WidgetCard from "../../../components/WidgetCard";
import { useI18n } from "../../../contexts/I18nContext";
import { capitalize } from "../../../util";
const SubscriptionStateCountWidget = ({ data, sx, }) => {
const { t } = useI18n();
if (data.length === 0)
return null;
return (React.createElement(WidgetCard, { gridColumn: { lg: "span 3", md: "span 6", sm: "span 1" }, gridRow: "span 1",
// order={{ md: 50 }}
sx: sx, title: t("Total Subscription Count") },
React.createElement(Stack, { direction: "column", px: 2 }, data
.filter(({ state }) => ["PENDING", "RUNNING"].includes(state))
.map((item) => (React.createElement(Stack, { key: item.state, alignItems: "center", direction: "row", justifyContent: "space-between", spacing: 1 },
React.createElement(Typography, null, capitalize(item.state)),
React.createElement(Typography, { fontSize: 28, fontWeight: 700 }, item.count)))))));
};
export default SubscriptionStateCountWidget;
//# sourceMappingURL=SubscriptionStateCountWidget.js.map