mirror of
https://github.com/hanzoai/ui.git
synced 2026-11-21 00:18:41 +00:00
Squash merge of shadcn-ui/ui main branch into hanzo/ui, bringing in: - [email protected] through [email protected] releases - New apps/v4 directory structure - Registry system improvements and MCP server - Framework support (Vue, Svelte, React Native) - New templates (vite-app, monorepo-next, laravel) - Zod 4 compatibility (scoped override for zod@>4) - Test fixture corrections for alias resolution All 867 merge conflicts resolved preserving Hanzo customizations. 1020/1020 shadcn tests pass.
39 lines
919 B
TypeScript
39 lines
919 B
TypeScript
"use client"
|
|
|
|
import { Check, PlusCircle } from "lucide-react"
|
|
|
|
import { cn } from "@/lib/utils"
|
|
import { useProject } from "@/hooks/use-project"
|
|
import { Button } from "@/registry/new-york/ui/button"
|
|
import {
|
|
Tooltip,
|
|
TooltipContent,
|
|
TooltipTrigger,
|
|
} from "@/registry/new-york/ui/tooltip"
|
|
|
|
export function ProjectAddButton({
|
|
name,
|
|
className,
|
|
...props
|
|
}: React.ComponentProps<typeof Button> & { name: string }) {
|
|
const { addBlock, isAdded } = useProject()
|
|
return (
|
|
<Tooltip>
|
|
<TooltipTrigger asChild>
|
|
<Button
|
|
variant="ghost"
|
|
size="sm"
|
|
className={cn("rounded-sm", className)}
|
|
onClick={() => {
|
|
addBlock(name)
|
|
}}
|
|
{...props}
|
|
>
|
|
{isAdded ? <Check /> : <PlusCircle />}
|
|
</Button>
|
|
</TooltipTrigger>
|
|
<TooltipContent sideOffset={10}>Add to Project</TooltipContent>
|
|
</Tooltip>
|
|
)
|
|
}
|