import { type ReactNode } from "react";
import { RotateCcw } from "lucide-react";
// --- settings-panel building blocks ------------------------------------------------------------
export function PanelHead({ children }: { children: ReactNode }) {
return (
{children}
);
}
export function Slider({
label,
value,
min,
max,
step,
suffix,
onChange,
onReset,
}: {
label: string;
value: number;
min: number;
max: number;
step: number;
suffix?: string;
onChange: (v: number) => void;
onReset?: () => void;
}) {
return (
);
}
export function Toggle({
label,
checked,
onChange,
}: {
label: string;
checked: boolean;
onChange: (v: boolean) => void;
}) {
return (
);
}
// A control button with a tooltip that opens ABOVE it (so it never clips off the bottom of the
// viewport, unlike a native title tooltip on the bottom control bar).
export function Ctrl({
label,
onClick,
disabled,
align = "center",
children,
}: {
label: string;
onClick: () => void;
disabled?: boolean;
// Tooltip horizontal anchor: "start"/"end" for edge buttons so it doesn't clip off the viewport.
align?: "start" | "center" | "end";
children: ReactNode;
}) {
const pos =
align === "start" ? "left-0" : align === "end" ? "right-0" : "left-1/2 -translate-x-1/2";
return (
{label}
);
}