WIP
This commit is contained in:
34
lama_cleaner/app/src/components/shared/Switch.tsx
Normal file
34
lama_cleaner/app/src/components/shared/Switch.tsx
Normal file
@@ -0,0 +1,34 @@
|
||||
import React from 'react'
|
||||
import * as SwitchPrimitive from '@radix-ui/react-switch'
|
||||
|
||||
const Switch = React.forwardRef<
|
||||
React.ElementRef<typeof SwitchPrimitive.Root>,
|
||||
React.ComponentProps<typeof SwitchPrimitive.Root>
|
||||
>((props, forwardedRef) => {
|
||||
const { className, ...itemProps } = props
|
||||
|
||||
return (
|
||||
<SwitchPrimitive.Root
|
||||
{...itemProps}
|
||||
ref={forwardedRef}
|
||||
className={`switch-root ${className}`}
|
||||
/>
|
||||
)
|
||||
})
|
||||
|
||||
const SwitchThumb = React.forwardRef<
|
||||
React.ElementRef<typeof SwitchPrimitive.Thumb>,
|
||||
React.ComponentProps<typeof SwitchPrimitive.Thumb>
|
||||
>((props, forwardedRef) => {
|
||||
const { className, ...itemProps } = props
|
||||
|
||||
return (
|
||||
<SwitchPrimitive.Thumb
|
||||
{...itemProps}
|
||||
ref={forwardedRef}
|
||||
className={`switch-thumb ${className}`}
|
||||
/>
|
||||
)
|
||||
})
|
||||
|
||||
export { Switch, SwitchThumb }
|
||||
Reference in New Issue
Block a user