summaryrefslogtreecommitdiff
path: root/src/components/Slider.tsx
diff options
context:
space:
mode:
authorYuval Adam <_@yuv.al>2025-09-24 09:12:44 +0200
committerYuval Adam <_@yuv.al>2025-09-24 09:12:44 +0200
commit4c5be8cf8d942743398581b46ac2c76d0ff273d8 (patch)
treeb182383a63302f24910c5534953d3624cb24f00d /src/components/Slider.tsx
parent490214f0a9be03130cf535bc5ae0b8aa3c6c16db (diff)
Initial migration
Diffstat (limited to 'src/components/Slider.tsx')
-rw-r--r--src/components/Slider.tsx43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/components/Slider.tsx b/src/components/Slider.tsx
new file mode 100644
index 0000000..2ee3fa1
--- /dev/null
+++ b/src/components/Slider.tsx
@@ -0,0 +1,43 @@
+import React from "react";
+import RcSlider from 'rc-slider';
+import { PLAYBACK_SLOTS } from "../config";
+import "rc-slider/assets/index.css";
+
+interface GeshemSliderProps {
+ playback?: string;
+ slider: number;
+ setSlider: React.Dispatch<React.SetStateAction<number>>;
+}
+
+export function Slider({ playback, slider, setSlider }: GeshemSliderProps) {
+ const handleStyle = {
+ height: 40,
+ width: 40,
+ border: 0,
+ marginTop: -10,
+ boxShadow: ".5px .5px 2px 1px rgba(0,0,0,.32)"
+ };
+
+ const railStyle = {
+ height: 20,
+ backgroundColor: "#3498db"
+ };
+
+ const trackStyle = {
+ display: "none"
+ };
+
+ return (
+ <div id="slider">
+ <RcSlider
+ min={0}
+ max={playback ? PLAYBACK_SLOTS : 9}
+ defaultValue={slider}
+ handleStyle={handleStyle}
+ railStyle={railStyle}
+ trackStyle={trackStyle}
+ onChange={(val) => setSlider(val as number)}
+ />
+ </div>
+ );
+} \ No newline at end of file