OpChan/app/src/components/ui/button.tsx
Danish Arora cca6299eb5
feat: library (#26)
* chore: move to /app

* chore: setup workspace

* chore: move lib

* wip

* fix: build and memory leak

* fix: app content hydration for message manager

* fix: non-ens wallets engagement, syncing hydration

* chore: improvements

* chore: IdentityContext

* chore: time range for sds store query to 1 month

* chore: remove client prop

* remove env logs

* wip

* FIX HYDRATION

* fix: message signing

* chore: rename providers

* fix: hydration interface

* state consistentcy

* fix: ens

* chore: minimal docs

* chore: update readme

* local build
2025-09-25 21:52:40 +05:30

29 lines
762 B
TypeScript

import * as React from 'react';
import { Slot } from '@radix-ui/react-slot';
import { type VariantProps } from 'class-variance-authority';
import { cn } from '../../utils'
import { buttonVariants } from './button-variants';
export interface ButtonProps
extends React.ButtonHTMLAttributes<HTMLButtonElement>,
VariantProps<typeof buttonVariants> {
asChild?: boolean;
}
const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
({ className, variant, size, asChild = false, ...props }, ref) => {
const Comp = asChild ? Slot : 'button';
return (
<Comp
className={cn(buttonVariants({ variant, size, className }))}
ref={ref}
{...props}
/>
);
}
);
Button.displayName = 'Button';
export { Button };