setting up test functionality

This commit is contained in:
masongga
2026-05-23 16:47:42 -06:00
parent 2ad9e42f3f
commit 94dbd18946
27 changed files with 1451 additions and 230 deletions

View File

@@ -0,0 +1,51 @@
"use client";
import { Label } from "@/components/ui/label";
type WellnessSliderProps = {
id: string;
label: string;
value: number;
min?: number;
max?: number;
step?: number;
unit?: string;
formatValue?: (value: number) => string;
disabled?: boolean;
onChange: (value: number) => void;
};
export function WellnessSlider({
id,
label,
value,
min = 1,
max = 5,
step = 1,
unit,
formatValue,
disabled = false,
onChange,
}: WellnessSliderProps) {
const displayValue = formatValue ? formatValue(value) : `${value}${unit ?? ""}`;
return (
<div className="space-y-2">
<div className="flex items-center justify-between text-sm">
<Label htmlFor={id}>{label}</Label>
<span className="text-muted-foreground">{displayValue}</span>
</div>
<input
id={id}
type="range"
min={min}
max={max}
step={step}
value={value}
disabled={disabled}
onChange={(event) => onChange(Number(event.target.value))}
className="w-full accent-primary disabled:opacity-60"
/>
</div>
);
}