Settings tweaks
This commit is contained in:
@@ -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">
|
||||
|
||||
Reference in New Issue
Block a user