feat: ✨ add new className props in SimpleSwitch component
This commit is contained in:
parent
49ac5d540d
commit
8ff23cc1f9
1 changed files with 4 additions and 1 deletions
|
|
@ -13,6 +13,7 @@ type SimpleSwitchProps = {
|
|||
label?: string;
|
||||
leftHelper?: string;
|
||||
rightHelper?: string;
|
||||
className?: string|null;
|
||||
required?: boolean;
|
||||
disabled?: boolean;
|
||||
parentErrors?: Record<string, string> | null,
|
||||
|
|
@ -26,6 +27,7 @@ export default function SimpleSwitch({
|
|||
label,
|
||||
leftHelper,
|
||||
rightHelper,
|
||||
className = null,
|
||||
required = false,
|
||||
disabled = false,
|
||||
parentErrors = null,
|
||||
|
|
@ -35,13 +37,14 @@ export default function SimpleSwitch({
|
|||
const localErrors = parentErrors ?? errors;
|
||||
|
||||
return (
|
||||
<div className="flex flex-col items-start w-fit gap-1.5">
|
||||
<div className={`flex flex-col items-start w-fit gap-1.5 ${className}`}>
|
||||
{label && (<Label htmlFor={name}>{label + (required ? " *" : "")}</Label>)}
|
||||
<div className="flex items-center gap-3">
|
||||
{leftHelper && (
|
||||
<small>{leftHelper}</small>
|
||||
)}
|
||||
<Switch
|
||||
id={name}
|
||||
name={name}
|
||||
onCheckedChange={(value) => setData(name, value)}
|
||||
required={required}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue