gitscope
https://dev.kronoz.win/r/marzneshin.git
dashboard/src/common/components/info-table/circular-progress-bar.tsx · v0.6.3
Source
1 d377c4c Dawsh 2y ago import { CircularProgress } from "@nextui-org/progress";
2 d377c4c Dawsh 2y ago import {
3 d377c4c Dawsh 2y ago TableCell,
4 d377c4c Dawsh 2y ago TableRow,
5 7389ad0 Mardin 2y ago } from "@marzneshin/common/components";
6 d377c4c Dawsh 2y ago import { useTranslation } from "react-i18next";
7 d377c4c Dawsh 2y ago import type { FC } from "react";
8 d377c4c Dawsh 2y ago
9 d377c4c Dawsh 2y ago export const CircularProgressBarRow: FC<{
10 d377c4c Dawsh 2y ago label: string;
11 d377c4c Dawsh 2y ago value: number;
12 d377c4c Dawsh 2y ago limit: number | undefined;
13 d377c4c Dawsh 2y ago }> = ({ label, value, limit }) => {
14 d377c4c Dawsh 2y ago const { t } = useTranslation()
15 d377c4c Dawsh 2y ago return (
16 d377c4c Dawsh 2y ago <TableRow>
17 d377c4c Dawsh 2y ago <TableCell>{label}</TableCell>
18 d377c4c Dawsh 2y ago <TableCell>
19 d377c4c Dawsh 2y ago {limit ? <CircularProgress size="sm" value={(value / limit) * 100} /> : t("unlimited")}
20 d377c4c Dawsh 2y ago </TableCell>
21 d377c4c Dawsh 2y ago </TableRow>
22 d377c4c Dawsh 2y ago )
23 d377c4c Dawsh 2y ago };