Home / File/ calendar-12.tsx — ui Source File

calendar-12.tsx — ui Source File

Architecture documentation for calendar-12.tsx, a tsx file in the ui codebase. 6 imports, 0 dependents.

File tsx ComponentRegistry ChartRegistry 6 imports 1 functions

Entity Profile

Dependency Diagram

graph LR
  70808a32_1704_8a71_58e0_5d8d941cb090["calendar-12.tsx"]
  1d141819_425e_b5fd_4c8e_32f7c6a42cf2["react"]
  70808a32_1704_8a71_58e0_5d8d941cb090 --> 1d141819_425e_b5fd_4c8e_32f7c6a42cf2
  bfc8708c_7488_3983_8998_32b793781735["react-day-picker"]
  70808a32_1704_8a71_58e0_5d8d941cb090 --> bfc8708c_7488_3983_8998_32b793781735
  dde83612_b728_e23b_d3a8_dccad8858873["locale"]
  70808a32_1704_8a71_58e0_5d8d941cb090 --> dde83612_b728_e23b_d3a8_dccad8858873
  5000e233_363d_e409_8b5c_7e80d38646fe["calendar"]
  70808a32_1704_8a71_58e0_5d8d941cb090 --> 5000e233_363d_e409_8b5c_7e80d38646fe
  95a7752f_4b97_5bde_5d7d_fca03536ac35["card"]
  70808a32_1704_8a71_58e0_5d8d941cb090 --> 95a7752f_4b97_5bde_5d7d_fca03536ac35
  d493776b_8734_5d8d_382d_0f77f309a72b["select"]
  70808a32_1704_8a71_58e0_5d8d941cb090 --> d493776b_8734_5d8d_382d_0f77f309a72b
  style 70808a32_1704_8a71_58e0_5d8d941cb090 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

"use client"

import * as React from "react"
import { type DateRange } from "react-day-picker"
import { enUS, es } from "react-day-picker/locale"

import { Calendar } from "@/registry/new-york/ui/calendar"
import {
  Card,
  CardContent,
  CardDescription,
  CardHeader,
  CardTitle,
} from "@/registry/new-york/ui/card"
import {
  Select,
  SelectContent,
  SelectItem,
  SelectTrigger,
  SelectValue,
} from "@/registry/new-york/ui/select"

const localizedStrings = {
  en: {
    title: "Book an appointment",
    description: "Select the dates for your appointment",
  },
  es: {
    title: "Reserva una cita",
    description: "Selecciona las fechas para tu cita",
  },
} as const

export default function Calendar12() {
  const [locale, setLocale] =
    React.useState<keyof typeof localizedStrings>("es")
  const [dateRange, setDateRange] = React.useState<DateRange | undefined>({
    from: new Date(2025, 8, 9),
    to: new Date(2025, 8, 17),
  })

  return (
    <Card>
      <CardHeader className="relative border-b">
        <CardTitle>{localizedStrings[locale].title}</CardTitle>
        <CardDescription>
          {localizedStrings[locale].description}
        </CardDescription>
        <Select
          value={locale}
          onValueChange={(value) =>
            setLocale(value as keyof typeof localizedStrings)
          }
        >
          <SelectTrigger className="absolute right-4 top-4 w-[100px]">
            <SelectValue placeholder="Language" />
          </SelectTrigger>
          <SelectContent align="end">
            <SelectItem value="es">Español</SelectItem>
            <SelectItem value="en">English</SelectItem>
          </SelectContent>
        </Select>
      </CardHeader>
      <CardContent className="pt-4">
        <Calendar
          mode="range"
          selected={dateRange}
          onSelect={setDateRange}
          defaultMonth={dateRange?.from}
          numberOfMonths={2}
          locale={locale === "es" ? es : enUS}
          className="bg-transparent p-0"
          buttonVariant="outline"
        />
      </CardContent>
    </Card>
  )
}

Subdomains

Functions

Dependencies

  • calendar
  • card
  • locale
  • react
  • react-day-picker
  • select

Frequently Asked Questions

What does calendar-12.tsx do?
calendar-12.tsx is a source file in the ui codebase, written in tsx. It belongs to the ComponentRegistry domain, ChartRegistry subdomain.
What functions are defined in calendar-12.tsx?
calendar-12.tsx defines 1 function(s): Calendar12.
What does calendar-12.tsx depend on?
calendar-12.tsx imports 6 module(s): calendar, card, locale, react, react-day-picker, select.
Where is calendar-12.tsx in the architecture?
calendar-12.tsx is located at deprecated/www/__registry__/new-york/blocks/calendar-12.tsx (domain: ComponentRegistry, subdomain: ChartRegistry, directory: deprecated/www/__registry__/new-york/blocks).

Analyze Your Own Codebase

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

Try Supermodel Free