Home / File/ project-add-button.tsx — ui Source File

project-add-button.tsx — ui Source File

Architecture documentation for project-add-button.tsx, a tsx file in the ui codebase. 5 imports, 0 dependents.

File tsx ComponentRegistry UIPrimitives 5 imports 1 functions

Entity Profile

Dependency Diagram

graph LR
  2c17c134_3443_ef6a_e132_38ab3ec6ab51["project-add-button.tsx"]
  d39cd1e4_1b2d_9aa2_1d29_fd0b4bfb61c3["lucide-react"]
  2c17c134_3443_ef6a_e132_38ab3ec6ab51 --> d39cd1e4_1b2d_9aa2_1d29_fd0b4bfb61c3
  79081a1f_55a3_945a_fb8c_d53d6d3eab81["utils"]
  2c17c134_3443_ef6a_e132_38ab3ec6ab51 --> 79081a1f_55a3_945a_fb8c_d53d6d3eab81
  b040c9b9_f8d3_f8cc_b6d5_1567390e2604["use-project"]
  2c17c134_3443_ef6a_e132_38ab3ec6ab51 --> b040c9b9_f8d3_f8cc_b6d5_1567390e2604
  aa2f3ec6_f291_3763_88ec_65a3f5ad5939["button"]
  2c17c134_3443_ef6a_e132_38ab3ec6ab51 --> aa2f3ec6_f291_3763_88ec_65a3f5ad5939
  4ad968a1_2bd7_248c_f5ed_f80d5b5f7417["tooltip"]
  2c17c134_3443_ef6a_e132_38ab3ec6ab51 --> 4ad968a1_2bd7_248c_f5ed_f80d5b5f7417
  style 2c17c134_3443_ef6a_e132_38ab3ec6ab51 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

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

Subdomains

Functions

Dependencies

  • button
  • lucide-react
  • tooltip
  • use-project
  • utils

Frequently Asked Questions

What does project-add-button.tsx do?
project-add-button.tsx is a source file in the ui codebase, written in tsx. It belongs to the ComponentRegistry domain, UIPrimitives subdomain.
What functions are defined in project-add-button.tsx?
project-add-button.tsx defines 1 function(s): ProjectAddButton.
What does project-add-button.tsx depend on?
project-add-button.tsx imports 5 module(s): button, lucide-react, tooltip, use-project, utils.
Where is project-add-button.tsx in the architecture?
project-add-button.tsx is located at deprecated/www/components/project-add-button.tsx (domain: ComponentRegistry, subdomain: UIPrimitives, directory: deprecated/www/components).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free