import * as ProgressPrimitive from "@radix-ui/react-progress"; import * as React from "react"; import { cn } from "~/lib/utils"; interface ProgressSegment { value: number; } type Props = React.ComponentPropsWithoutRef & { color?: string; segments: ProgressSegment[]; }; const Progress = React.forwardRef< React.ElementRef, Props >(({ className, segments, color, ...props }, ref) => { const sortedSegments = segments.sort((a, b) => b.value - a.value); return ( {sortedSegments.map((segment, index) => ( ))} ); }); Progress.displayName = "Progress"; export { Progress };