refactor: replace html range input with shadcn slider in batch operations
This commit is contained in:
@@ -11,6 +11,7 @@ import {
|
|||||||
} from '@/components/ui/select';
|
} from '@/components/ui/select';
|
||||||
import { Input } from '@/components/ui/input';
|
import { Input } from '@/components/ui/input';
|
||||||
import { Textarea } from '@/components/ui/textarea';
|
import { Textarea } from '@/components/ui/textarea';
|
||||||
|
import { Slider } from '@/components/ui/slider';
|
||||||
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
|
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
|
||||||
import { PaletteGrid } from '@/components/pastel/PaletteGrid';
|
import { PaletteGrid } from '@/components/pastel/PaletteGrid';
|
||||||
import { ExportMenu } from '@/components/pastel/ExportMenu';
|
import { ExportMenu } from '@/components/pastel/ExportMenu';
|
||||||
@@ -143,17 +144,21 @@ export default function BatchPage() {
|
|||||||
</SelectContent>
|
</SelectContent>
|
||||||
</Select>
|
</Select>
|
||||||
|
|
||||||
<div>
|
<div className="space-y-4 pt-2">
|
||||||
<label className="text-sm font-medium mb-2 block">
|
<div className="flex items-center justify-between">
|
||||||
Amount: {operation === 'rotate' ? (amount * 360).toFixed(0) + '°' : (amount * 100).toFixed(0) + '%'}
|
<label className="text-sm font-medium">
|
||||||
</label>
|
Amount
|
||||||
<Input
|
</label>
|
||||||
type="range"
|
<span className="text-xs text-muted-foreground">
|
||||||
min="0"
|
{operation === 'rotate' ? (amount * 360).toFixed(0) + '°' : (amount * 100).toFixed(0) + '%'}
|
||||||
max="1"
|
</span>
|
||||||
step="0.01"
|
</div>
|
||||||
value={amount}
|
<Slider
|
||||||
onChange={(e) => setAmount(parseFloat(e.target.value))}
|
min={0}
|
||||||
|
max={1}
|
||||||
|
step={0.01}
|
||||||
|
value={[amount]}
|
||||||
|
onValueChange={(vals) => setAmount(vals[0])}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user