Home / File/ hover-card-rtl.tsx — ui Source File

hover-card-rtl.tsx — ui Source File

Architecture documentation for hover-card-rtl.tsx, a tsx file in the ui codebase. 3 imports, 0 dependents.

File tsx DocumentationAtlas SearchAPI 3 imports 1 functions

Entity Profile

Dependency Diagram

graph LR
  06faa55d_daae_78d7_7593_6cf42bb2a774["hover-card-rtl.tsx"]
  c79cdc74_50fb_62bd_465f_35936d2c5eac["button"]
  06faa55d_daae_78d7_7593_6cf42bb2a774 --> c79cdc74_50fb_62bd_465f_35936d2c5eac
  73a96ae5_55be_ae37_069f_98bd2b5740de["hover-card"]
  06faa55d_daae_78d7_7593_6cf42bb2a774 --> 73a96ae5_55be_ae37_069f_98bd2b5740de
  2c1404ab_bf28_6225_f9a0_b9e29400c66c["language-selector"]
  06faa55d_daae_78d7_7593_6cf42bb2a774 --> 2c1404ab_bf28_6225_f9a0_b9e29400c66c
  style 06faa55d_daae_78d7_7593_6cf42bb2a774 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

"use client"

import { Button } from "@/examples/radix/ui-rtl/button"
import {
  HoverCard,
  HoverCardContent,
  HoverCardTrigger,
} from "@/examples/radix/ui-rtl/hover-card"

import {
  useTranslation,
  type Translations,
} from "@/components/language-selector"

const translations: Translations = {
  en: {
    dir: "ltr",
    values: {
      trigger: "Wireless Headphones",
      name: "Wireless Headphones",
      price: "$99.99",
      left: "Left",
      top: "Top",
      bottom: "Bottom",
      right: "Right",
    },
  },
  ar: {
    dir: "rtl",
    values: {
      trigger: "سماعات لاسلكية",
      name: "سماعات لاسلكية",
      price: "٩٩.٩٩ $",
      left: "يسار",
      top: "أعلى",
      bottom: "أسفل",
      right: "يمين",
    },
  },
  he: {
    dir: "rtl",
    values: {
      trigger: "אוזניות אלחוטיות",
      name: "אוזניות אלחוטיות",
      price: "99.99 $",
      left: "שמאל",
      top: "למעלה",
      bottom: "למטה",
      right: "ימין",
    },
  },
}

const physicalSides: Array<"left" | "top" | "bottom" | "right"> = [
  "left",
  "top",
  "bottom",
  "right",
]

export function HoverCardRtl() {
  const { dir, t } = useTranslation(translations, "ar")

  return (
    <div className="flex flex-wrap justify-center gap-2">
      {physicalSides.map((side) => (
        <HoverCard key={side} openDelay={10} closeDelay={100}>
          <HoverCardTrigger asChild>
            <Button variant="outline">{t[side]}</Button>
          </HoverCardTrigger>
          <HoverCardContent
            side={side}
            className="flex w-64 flex-col gap-1"
            dir={dir}
          >
            <div className="font-semibold">{t.name}</div>
            <div className="text-muted-foreground text-sm">{t.price}</div>
          </HoverCardContent>
        </HoverCard>
      ))}
    </div>
  )
}

Subdomains

Functions

Dependencies

  • button
  • hover-card
  • language-selector

Frequently Asked Questions

What does hover-card-rtl.tsx do?
hover-card-rtl.tsx is a source file in the ui codebase, written in tsx. It belongs to the DocumentationAtlas domain, SearchAPI subdomain.
What functions are defined in hover-card-rtl.tsx?
hover-card-rtl.tsx defines 1 function(s): HoverCardRtl.
What does hover-card-rtl.tsx depend on?
hover-card-rtl.tsx imports 3 module(s): button, hover-card, language-selector.
Where is hover-card-rtl.tsx in the architecture?
hover-card-rtl.tsx is located at apps/v4/examples/radix/hover-card-rtl.tsx (domain: DocumentationAtlas, subdomain: SearchAPI, directory: apps/v4/examples/radix).

Analyze Your Own Codebase

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

Try Supermodel Free