ok, great but make the slide go from 0% to 90%
0% = 50 hours 90% 5 hou
This commit is contained in:
@@ -25,12 +25,13 @@ const stageLabels = [
|
||||
"70%", // 70
|
||||
"80%", // 80
|
||||
"90%", // 90
|
||||
"100%", // 100
|
||||
];
|
||||
|
||||
const calculateHours = (projectStage: number): number => {
|
||||
// Scale hours from 50 down to 0 as projectStage goes from 0 to 100.
|
||||
return Math.round(((100 - projectStage) / 100) * 50);
|
||||
// 0% -> 50 hours
|
||||
// 90% -> 5 hours
|
||||
// Linear interpolation: H(p) = 50 - (45/90) * p = 50 - 0.5 * p
|
||||
return 50 - (0.5 * projectStage);
|
||||
};
|
||||
|
||||
export function Step3ProjectStage({ onNext, onBack, onUpdateData, formData }: Step3Props) {
|
||||
@@ -61,13 +62,13 @@ export function Step3ProjectStage({ onNext, onBack, onUpdateData, formData }: St
|
||||
<Slider
|
||||
defaultValue={value}
|
||||
onValueChange={handleSliderChange}
|
||||
max={100}
|
||||
max={90}
|
||||
step={10}
|
||||
className="w-full"
|
||||
/>
|
||||
<div className="flex justify-between text-xs text-muted-foreground mt-2">
|
||||
<span>0%</span>
|
||||
<span>100%</span>
|
||||
<span>90%</span>
|
||||
</div>
|
||||
</div>
|
||||
<div className="mt-16 flex w-full items-center justify-between">
|
||||
|
||||
Reference in New Issue
Block a user