import * as React from 'react'; import LinearProgress, { LinearProgressProps } from '@mui/material/LinearProgress'; import Typography from '@mui/material/Typography'; import Box from '@mui/material/Box'; type LinearProgressWithLabelAndValueProps = LinearProgressProps & { min: number; max: number; value: number; }; function LinearProgressWithLabelAndValue({ max, min, value, ...rest }: LinearProgressWithLabelAndValueProps) { const progressText = `Elevator at floor ${value} out of ${max}.`; const progressId = React.useId(); return (
Elevator status {progressText}
); } export default function LinearWithAriaValueText() { const [progress, setProgress] = React.useState(1); React.useEffect(() => { const timer = setInterval(() => { setProgress((prevProgress) => (prevProgress >= 10 ? 1 : prevProgress + 1)); }, 800); return () => { clearInterval(timer); }; }, []); return ( ); }