Home / File/ item-demo.tsx — ui Source File

item-demo.tsx — ui Source File

Architecture documentation for item-demo.tsx, a tsx file in the ui codebase. 4 imports, 1 dependents.

File tsx Internationalization Dictionary 4 imports 1 dependents 1 functions

Entity Profile

Dependency Diagram

graph LR
  2d34c4a4_4706_8226_f853_4d56a22d8ac0["item-demo.tsx"]
  43bb9fc1_6eab_13df_a99b_981eb13b9ec1["button"]
  2d34c4a4_4706_8226_f853_4d56a22d8ac0 --> 43bb9fc1_6eab_13df_a99b_981eb13b9ec1
  dd79944f_d284_50b0_3795_7290597eafe2["item"]
  2d34c4a4_4706_8226_f853_4d56a22d8ac0 --> dd79944f_d284_50b0_3795_7290597eafe2
  d39cd1e4_1b2d_9aa2_1d29_fd0b4bfb61c3["lucide-react"]
  2d34c4a4_4706_8226_f853_4d56a22d8ac0 --> d39cd1e4_1b2d_9aa2_1d29_fd0b4bfb61c3
  2c1404ab_bf28_6225_f9a0_b9e29400c66c["language-selector"]
  2d34c4a4_4706_8226_f853_4d56a22d8ac0 --> 2c1404ab_bf28_6225_f9a0_b9e29400c66c
  a20493d4_39f4_bced_97b9_027078a02a91["index.tsx"]
  a20493d4_39f4_bced_97b9_027078a02a91 --> 2d34c4a4_4706_8226_f853_4d56a22d8ac0
  style 2d34c4a4_4706_8226_f853_4d56a22d8ac0 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

"use client"

import { Button } from "@/examples/base/ui-rtl/button"
import {
  Item,
  ItemActions,
  ItemContent,
  ItemDescription,
  ItemMedia,
  ItemTitle,
} from "@/examples/base/ui-rtl/item"
import { BadgeCheckIcon, ChevronRightIcon } from "lucide-react"

import { useLanguageContext } from "@/components/language-selector"

const translations = {
  ar: {
    dir: "rtl" as const,
    twoFactor: "المصادقة الثنائية",
    twoFactorDescription: "التحقق عبر البريد الإلكتروني أو رقم الهاتف.",
    enable: "تفعيل",
    verified: "تم التحقق من ملفك الشخصي.",
  },
  he: {
    dir: "rtl" as const,
    twoFactor: "אימות דו-שלבי",
    twoFactorDescription: "אמת באמצעות אימייל או מספר טלפון.",
    enable: "הפעל",
    verified: "הפרופיל שלך אומת.",
  },
}

export function ItemDemo() {
  const context = useLanguageContext()
  const lang = context?.language === "he" ? "he" : "ar"
  const t = translations[lang]

  return (
    <div dir={t.dir} className="flex w-full max-w-md flex-col gap-6">
      <Item variant="outline">
        <ItemContent>
          <ItemTitle>{t.twoFactor}</ItemTitle>
          <ItemDescription className="text-pretty xl:hidden 2xl:block">
            {t.twoFactorDescription}
          </ItemDescription>
        </ItemContent>
        <ItemActions>
          <Button size="sm">{t.enable}</Button>
        </ItemActions>
      </Item>
      <Item variant="outline" size="sm">
        <ItemMedia>
          <BadgeCheckIcon className="size-5" />
        </ItemMedia>
        <ItemContent>
          <ItemTitle>{t.verified}</ItemTitle>
        </ItemContent>
        <ItemActions>
          <ChevronRightIcon className="size-4 rtl:rotate-180" />
        </ItemActions>
      </Item>
    </div>
  )
}

Subdomains

Functions

Dependencies

  • button
  • item
  • language-selector
  • lucide-react

Frequently Asked Questions

What does item-demo.tsx do?
item-demo.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 item-demo.tsx?
item-demo.tsx defines 1 function(s): ItemDemo.
What does item-demo.tsx depend on?
item-demo.tsx imports 4 module(s): button, item, language-selector, lucide-react.
What files import item-demo.tsx?
item-demo.tsx is imported by 1 file(s): index.tsx.
Where is item-demo.tsx in the architecture?
item-demo.tsx is located at apps/v4/app/(app)/examples/rtl/components/item-demo.tsx (domain: Internationalization, subdomain: Dictionary, directory: apps/v4/app/(app)/examples/rtl/components).

Analyze Your Own Codebase

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

Try Supermodel Free