mirror of
https://github.com/logos-messaging/OpChan.git
synced 2026-01-12 01:33:05 +00:00
23 lines
683 B
TypeScript
23 lines
683 B
TypeScript
import * as React from 'react';
|
|
import * as TogglePrimitive from '@radix-ui/react-toggle';
|
|
import { type VariantProps } from 'class-variance-authority';
|
|
|
|
import { cn } from '@/lib/utils';
|
|
import { toggleVariants } from './toggle-variants';
|
|
|
|
const Toggle = React.forwardRef<
|
|
React.ElementRef<typeof TogglePrimitive.Root>,
|
|
React.ComponentPropsWithoutRef<typeof TogglePrimitive.Root> &
|
|
VariantProps<typeof toggleVariants>
|
|
>(({ className, variant, size, ...props }, ref) => (
|
|
<TogglePrimitive.Root
|
|
ref={ref}
|
|
className={cn(toggleVariants({ variant, size, className }))}
|
|
{...props}
|
|
/>
|
|
));
|
|
|
|
Toggle.displayName = TogglePrimitive.Root.displayName;
|
|
|
|
export { Toggle };
|