admin/components/formElements/Switch.tsx
alisaza e1eaf5eff5 feat: initial ghabilee-admin backoffice app
Extract admin dashboard from ghabilee-frontend2 into a dedicated Next.js
app for backoffice.ghabilee.ir (no SEO indexing / Clarity).
2026-09-05 13:12:59 +03:30

43 lines
836 B
TypeScript

import React, { type PropsWithChildren } from 'react'
import { Switch as HeroSwitch } from '@/components/heroui/SelectionControls'
import { cn } from '@/lib/cn'
interface SwitchProps {
className?: string
classNames?: {
label?: string
}
isDisabled?: boolean
isSelected?: boolean
size?: 'sm' | 'md' | 'lg'
onValueChange?: (isSelected: boolean) => void
}
const Switch = ({
children,
className,
classNames,
isDisabled,
isSelected,
size = 'md',
onValueChange,
}: PropsWithChildren<SwitchProps>) => {
return (
<HeroSwitch
className={className}
classNames={{
label: cn(classNames?.label),
}}
isDisabled={isDisabled}
isSelected={isSelected}
size={size}
onValueChange={onValueChange}
>
{children}
</HeroSwitch>
)
}
export default Switch