Settings tweaks

This commit is contained in:
Gavin McDonald
2025-07-03 14:31:32 -04:00
parent ed6fef5ef1
commit 97b6b66bad
5 changed files with 27 additions and 21 deletions

View File

@@ -4,13 +4,16 @@ export interface SwitchProps {
label: string;
value: boolean;
toggleAction: ChangeEventHandler<HTMLInputElement>;
className?: string;
}
const nonInitialCaps = /(?!^)([A-Z])/g;
export default function Switch({ label, value, toggleAction }: SwitchProps) {
export default function Switch({ label, value, toggleAction, className }: SwitchProps) {
return (
<label className="flex items-center justify-between w-full gap-2 cursor-pointer text-yellow-400 hover:text-yellow-300">
<label
className={`flex items-center justify-between gap-2 w-full cursor-pointer text-yellow-400 hover:text-yellow-300 ${className}`}
>
<span className="text-sm capitalize">{label.replace(nonInitialCaps, ' $1')}</span>
<div className="relative inline-block w-8 h-4 align-middle select-none transition duration-200 ease-in">