Files
controller-v2/client/src/pages/eq/components/PeqUndoButton.tsx
T
2026-08-14 16:40:47 +08:00

44 lines
890 B
TypeScript

import { cn } from "@/lib/utils";
type PeqUndoButtonProps = {
disabled?: boolean;
label: string;
onClick: () => void;
className?: string;
};
const pillStyle = {
background: "rgba(44,44,46,0.7)",
border: "1px solid rgba(255,255,255,0.08)",
} as const;
/**
* EQ page undo control — disabled when the undo stack is empty.
*/
export function PeqUndoButton({
disabled = false,
label,
onClick,
className,
}: PeqUndoButtonProps) {
return (
<button
type="button"
disabled={disabled}
aria-label={label}
title={label}
onClick={onClick}
className={cn(
"px-3 py-1 rounded-[8px] text-[11px] transition-colors",
disabled
? "text-white/25 cursor-not-allowed opacity-50"
: "text-white/50 active:text-white",
className,
)}
style={pillStyle}
>
{label}
</button>
);
}