diff options
Diffstat (limited to 'packages/memory-graph/src/ui/button.tsx')
| -rw-r--r-- | packages/memory-graph/src/ui/button.tsx | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/packages/memory-graph/src/ui/button.tsx b/packages/memory-graph/src/ui/button.tsx new file mode 100644 index 00000000..031f2cc8 --- /dev/null +++ b/packages/memory-graph/src/ui/button.tsx @@ -0,0 +1,30 @@ +import { Slot } from "@radix-ui/react-slot"; +import type * as React from "react"; +import { button, type ButtonVariants } from "./button.css"; + +function Button({ + className, + variant, + size, + asChild = false, + ...props +}: React.ComponentProps<"button"> & + ButtonVariants & { + asChild?: boolean; + }) { + const Comp = asChild ? Slot : "button"; + + const combinedClassName = className + ? `${button({ variant, size })} ${className}` + : button({ variant, size }); + + return ( + <Comp + className={combinedClassName} + data-slot="button" + {...props} + /> + ); +} + +export { Button, button as buttonVariants }; |