Home / File/ search-directory.tsx — ui Source File

search-directory.tsx — ui Source File

Architecture documentation for search-directory.tsx, a tsx file in the ui codebase. 5 imports, 1 dependents.

File tsx Internationalization Dictionary 5 imports 1 dependents 1 functions

Entity Profile

Dependency Diagram

graph LR
  f34c1490_de6c_039c_8593_c5f7699bd714["search-directory.tsx"]
  1d141819_425e_b5fd_4c8e_32f7c6a42cf2["react"]
  f34c1490_de6c_039c_8593_c5f7699bd714 --> 1d141819_425e_b5fd_4c8e_32f7c6a42cf2
  d39cd1e4_1b2d_9aa2_1d29_fd0b4bfb61c3["lucide-react"]
  f34c1490_de6c_039c_8593_c5f7699bd714 --> d39cd1e4_1b2d_9aa2_1d29_fd0b4bfb61c3
  9a720389_619b_f0f8_ab98_100af17f6d90["use-search-registry"]
  f34c1490_de6c_039c_8593_c5f7699bd714 --> 9a720389_619b_f0f8_ab98_100af17f6d90
  169af77a_46c3_8fec_4801_f34a0f1a3471["field"]
  f34c1490_de6c_039c_8593_c5f7699bd714 --> 169af77a_46c3_8fec_4801_f34a0f1a3471
  41df1c2c_a3b4_dc22_8bc9_310fe8b6ba9b["input-group"]
  f34c1490_de6c_039c_8593_c5f7699bd714 --> 41df1c2c_a3b4_dc22_8bc9_310fe8b6ba9b
  3efca8a9_c761_49f2_7986_266f8b6c8fb6["directory-list.tsx"]
  3efca8a9_c761_49f2_7986_266f8b6c8fb6 --> f34c1490_de6c_039c_8593_c5f7699bd714
  style f34c1490_de6c_039c_8593_c5f7699bd714 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import * as React from "react"
import { Search, X } from "lucide-react"

import { useSearchRegistry } from "@/hooks/use-search-registry"
import { Field } from "@/registry/new-york-v4/ui/field"
import {
  InputGroup,
  InputGroupAddon,
  InputGroupButton,
  InputGroupInput,
} from "@/registry/new-york-v4/ui/input-group"

export const SearchDirectory = () => {
  const { query, registries, setQuery } = useSearchRegistry()

  const onQueryChange = (e: React.ChangeEvent<HTMLInputElement>) => {
    const value = e.target.value
    setQuery(value)
  }

  return (
    <Field>
      <InputGroup>
        <InputGroupAddon>
          <Search />
        </InputGroupAddon>
        <InputGroupInput
          placeholder="Search"
          value={query}
          onChange={onQueryChange}
        />
        <InputGroupAddon align="inline-end">
          <span className="text-muted-foreground tabular-nums sm:text-xs">
            {registries.length}{" "}
            {registries.length === 1 ? "registry" : "registries"}
          </span>
        </InputGroupAddon>
        <InputGroupAddon
          align="inline-end"
          data-disabled={!query.length}
          className="data-[disabled=true]:hidden"
        >
          <InputGroupButton
            aria-label="Clear"
            title="Clear"
            size="icon-xs"
            onClick={() => setQuery(null)}
          >
            <X />
          </InputGroupButton>
        </InputGroupAddon>
      </InputGroup>
    </Field>
  )
}

Subdomains

Functions

Dependencies

  • field
  • input-group
  • lucide-react
  • react
  • use-search-registry

Frequently Asked Questions

What does search-directory.tsx do?
search-directory.tsx is a source file in the ui codebase, written in tsx. It belongs to the Internationalization domain, Dictionary subdomain.
What functions are defined in search-directory.tsx?
search-directory.tsx defines 1 function(s): SearchDirectory.
What does search-directory.tsx depend on?
search-directory.tsx imports 5 module(s): field, input-group, lucide-react, react, use-search-registry.
What files import search-directory.tsx?
search-directory.tsx is imported by 1 file(s): directory-list.tsx.
Where is search-directory.tsx in the architecture?
search-directory.tsx is located at apps/v4/components/search-directory.tsx (domain: Internationalization, subdomain: Dictionary, directory: apps/v4/components).

Analyze Your Own Codebase

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

Try Supermodel Free