Home / File/ spinner-badge.tsx — ui Source File

spinner-badge.tsx — ui Source File

Architecture documentation for spinner-badge.tsx, a tsx file in the ui codebase. 3 imports, 1 dependents.

File tsx Internationalization Dictionary 3 imports 1 dependents 1 functions

Entity Profile

Dependency Diagram

graph LR
  47ace017_01d8_261d_b1b6_8bda7f68a742["spinner-badge.tsx"]
  90b8a2cf_9327_90bb_6e4f_7132c87c77ec["badge"]
  47ace017_01d8_261d_b1b6_8bda7f68a742 --> 90b8a2cf_9327_90bb_6e4f_7132c87c77ec
  883da1ad_449f_ee4a_3133_4f4e76e38d95["spinner"]
  47ace017_01d8_261d_b1b6_8bda7f68a742 --> 883da1ad_449f_ee4a_3133_4f4e76e38d95
  2c1404ab_bf28_6225_f9a0_b9e29400c66c["language-selector"]
  47ace017_01d8_261d_b1b6_8bda7f68a742 --> 2c1404ab_bf28_6225_f9a0_b9e29400c66c
  a20493d4_39f4_bced_97b9_027078a02a91["index.tsx"]
  a20493d4_39f4_bced_97b9_027078a02a91 --> 47ace017_01d8_261d_b1b6_8bda7f68a742
  style 47ace017_01d8_261d_b1b6_8bda7f68a742 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

"use client"

import { Badge } from "@/examples/base/ui-rtl/badge"
import { Spinner } from "@/examples/base/ui-rtl/spinner"

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

const translations = {
  ar: {
    dir: "rtl" as const,
    syncing: "جارٍ المزامنة",
    updating: "جارٍ التحديث",
    loading: "جارٍ التحميل",
  },
  he: {
    dir: "rtl" as const,
    syncing: "מסנכרן",
    updating: "מעדכן",
    loading: "טוען",
  },
}

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

  return (
    <div dir={t.dir} className="flex items-center gap-2">
      <Badge>
        <Spinner />
        {t.syncing}
      </Badge>
      <Badge variant="secondary">
        <Spinner />
        {t.updating}
      </Badge>
      <Badge variant="outline">
        <Spinner />
        {t.loading}
      </Badge>
    </div>
  )
}

Subdomains

Functions

Dependencies

  • badge
  • language-selector
  • spinner

Frequently Asked Questions

What does spinner-badge.tsx do?
spinner-badge.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 spinner-badge.tsx?
spinner-badge.tsx defines 1 function(s): SpinnerBadge.
What does spinner-badge.tsx depend on?
spinner-badge.tsx imports 3 module(s): badge, language-selector, spinner.
What files import spinner-badge.tsx?
spinner-badge.tsx is imported by 1 file(s): index.tsx.
Where is spinner-badge.tsx in the architecture?
spinner-badge.tsx is located at apps/v4/app/(app)/examples/rtl/components/spinner-badge.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