Files
ui/deprecated/www/components/project-add-button.tsx
zeekay 11b02e8dcb feat: sync with upstream shadcn/ui (through [email protected])
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.
2026-02-09 10:44:26 -08:00

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>
)
}