Extract admin dashboard from ghabilee-frontend2 into a dedicated Next.js app for backoffice.ghabilee.ir (no SEO indexing / Clarity).
43 lines
836 B
TypeScript
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
|