Improve the frontend 3

This commit is contained in:
Urtzi Alfaro
2025-10-30 21:08:07 +01:00
parent 36217a2729
commit 63f5c6d512
184 changed files with 21512 additions and 7442 deletions

View File

@@ -0,0 +1,46 @@
import React from 'react';
export interface SliderProps {
min: number;
max: number;
step?: number;
value: number[];
onValueChange: (value: number[]) => void;
disabled?: boolean;
className?: string;
}
const Slider: React.FC<SliderProps> = ({
min,
max,
step = 1,
value,
onValueChange,
disabled = false,
className = '',
}) => {
const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
const newValue = parseFloat(e.target.value);
onValueChange([newValue]);
};
return (
<div className={`flex items-center space-x-4 ${className}`}>
<input
type="range"
min={min}
max={max}
step={step}
value={value[0]}
onChange={handleChange}
disabled={disabled}
className="w-full h-2 bg-[var(--bg-secondary)] rounded-lg appearance-none cursor-pointer accent-[var(--color-primary)] disabled:opacity-50 disabled:cursor-not-allowed"
/>
<span className="text-sm text-[var(--text-secondary)] min-w-12">
{(value[0] * 100).toFixed(0)}%
</span>
</div>
);
};
export default Slider;

View File

@@ -0,0 +1,3 @@
export { default } from './Slider';
export { default as Slider } from './Slider';
export type { SliderProps } from './Slider';