carousel-rtl.tsx — ui Source File
Architecture documentation for carousel-rtl.tsx, a tsx file in the ui codebase. 4 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR ee5f77de_c428_7cc9_5d60_6e845e4412c1["carousel-rtl.tsx"] 1d141819_425e_b5fd_4c8e_32f7c6a42cf2["react"] ee5f77de_c428_7cc9_5d60_6e845e4412c1 --> 1d141819_425e_b5fd_4c8e_32f7c6a42cf2 3f7abb04_1707_b324_1349_fc528ddbfb88["card"] ee5f77de_c428_7cc9_5d60_6e845e4412c1 --> 3f7abb04_1707_b324_1349_fc528ddbfb88 decd9d19_d786_f7c0_a531_94daed3d5b0a["carousel"] ee5f77de_c428_7cc9_5d60_6e845e4412c1 --> decd9d19_d786_f7c0_a531_94daed3d5b0a 2c1404ab_bf28_6225_f9a0_b9e29400c66c["language-selector"] ee5f77de_c428_7cc9_5d60_6e845e4412c1 --> 2c1404ab_bf28_6225_f9a0_b9e29400c66c style ee5f77de_c428_7cc9_5d60_6e845e4412c1 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
"use client"
import * as React from "react"
import { Card, CardContent } from "@/examples/base/ui-rtl/card"
import {
Carousel,
CarouselContent,
CarouselItem,
CarouselNext,
CarouselPrevious,
} from "@/examples/base/ui-rtl/carousel"
import {
useTranslation,
type Translations,
} from "@/components/language-selector"
const translations: Translations = {
en: {
dir: "ltr",
values: {},
},
ar: {
dir: "rtl",
values: {},
},
he: {
dir: "rtl",
values: {},
},
}
function toArabicNumerals(num: number): string {
const arabicNumerals = ["٠", "١", "٢", "٣", "٤", "٥", "٦", "٧", "٨", "٩"]
return num
.toString()
.split("")
.map((digit) => arabicNumerals[parseInt(digit, 10)])
.join("")
}
export function CarouselRtl() {
const { dir, language } = useTranslation(translations, "ar")
const formatNumber = (num: number): string => {
if (language === "ar") {
return toArabicNumerals(num)
}
return num.toString()
}
return (
<Carousel
dir={dir}
className="w-full max-w-[12rem] sm:max-w-xs"
opts={{
direction: dir,
}}
>
<CarouselContent>
{Array.from({ length: 5 }).map((_, index) => (
<CarouselItem key={index}>
<div className="p-1">
<Card>
<CardContent className="flex aspect-square items-center justify-center p-6">
<span className="text-4xl font-semibold">
{formatNumber(index + 1)}
</span>
</CardContent>
</Card>
</div>
</CarouselItem>
))}
</CarouselContent>
<CarouselPrevious />
<CarouselNext />
</Carousel>
)
}
Domain
Subdomains
Functions
Dependencies
- card
- carousel
- language-selector
- react
Source
Frequently Asked Questions
What does carousel-rtl.tsx do?
carousel-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 carousel-rtl.tsx?
carousel-rtl.tsx defines 2 function(s): CarouselRtl, toArabicNumerals.
What does carousel-rtl.tsx depend on?
carousel-rtl.tsx imports 4 module(s): card, carousel, language-selector, react.
Where is carousel-rtl.tsx in the architecture?
carousel-rtl.tsx is located at apps/v4/examples/base/carousel-rtl.tsx (domain: DocumentationAtlas, subdomain: SearchAPI, directory: apps/v4/examples/base).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free