(feat:components) add label props

This commit is contained in:
ManishMadan2882
2025-01-31 06:23:54 +05:30
parent 4cd2b73f19
commit a69e81076a
2 changed files with 29 additions and 19 deletions

View File

@@ -23,9 +23,12 @@ const ToggleSwitch: React.FC<ToggleSwitchProps> = ({
}) => {
return (
<label
className={`cursor-pointer select-none items-center ${disabled ? 'opacity-50 cursor-not-allowed' : ''} ${className}`}
className={`cursor-pointer select-none justify-between flex flex-row items-center ${disabled ? 'opacity-50 cursor-not-allowed' : ''} ${className}`}
htmlFor={id}
>
{label && (
<span className="mr-2 text-eerie-black dark:text-white">{label}</span>
)}
<div className="relative">
<input
type="checkbox"
@@ -48,9 +51,6 @@ const ToggleSwitch: React.FC<ToggleSwitchProps> = ({
}`}
></div>
</div>
{label && (
<span className="ml-2 text-eerie-black dark:text-white">{label}</span>
)}
</label>
);
};