'use client'; import * as React from 'react'; import Box from '@mui/material/Box'; import Button from '@mui/material/Button'; import Card from '@mui/material/Card'; import CardContent from '@mui/material/CardContent'; import Stack from '@mui/material/Stack'; import Typography from '@mui/material/Typography'; import { RadialBar, RadialBarChart } from 'recharts'; import { NoSsr } from '@/components/core/no-ssr'; export interface DailyProgressProps { timeCurrent: number; timeGoal: number; } export function DailyProgress({ timeCurrent, timeGoal }: DailyProgressProps): React.JSX.Element { const chartSize = 250; const timeLeft = timeGoal - timeCurrent; const progress = Math.round((timeCurrent / timeGoal) * 100); const data = [ { name: 'Empty', value: 100 }, { name: 'Usage', value: progress }, ] satisfies { name: string; value: number }[]; return ( }> Time left {timeLeft} min Today's progress of your {timeGoal}-minutes goal You have used{' '} {new Intl.NumberFormat('en-US', { style: 'percent', maximumFractionDigits: 2 }).format(progress / 100)} of your available spots. Upgrade plan to create more projects.
); }