mirror of
https://github.com/hanzoai/shadcn.git
synced 2026-10-30 18:22:59 +00:00
Squash merge of shadcn-ui/ui main branch into hanzo/ui, bringing in: - [email protected] through [email protected] releases - New apps/v4 directory structure - Registry system improvements and MCP server - Framework support (Vue, Svelte, React Native) - New templates (vite-app, monorepo-next, laravel) - Zod 4 compatibility (scoped override for zod@>4) - Test fixture corrections for alias resolution All 867 merge conflicts resolved preserving Hanzo customizations. 1020/1020 shadcn tests pass.
57 lines
1.5 KiB
TypeScript
57 lines
1.5 KiB
TypeScript
"use client"
|
|
|
|
import { Button } from "@/examples/base/ui-rtl/button"
|
|
import { ButtonGroup } from "@/examples/base/ui-rtl/button-group"
|
|
import { ArrowLeftIcon, ArrowRightIcon } from "lucide-react"
|
|
|
|
import { useLanguageContext } from "@/components/language-selector"
|
|
|
|
const translations = {
|
|
ar: {
|
|
dir: "rtl" as const,
|
|
locale: "ar-SA",
|
|
previous: "السابق",
|
|
next: "التالي",
|
|
},
|
|
he: {
|
|
dir: "rtl" as const,
|
|
locale: "he-IL",
|
|
previous: "הקודם",
|
|
next: "הבא",
|
|
},
|
|
}
|
|
|
|
function formatNumber(value: number, locale: string) {
|
|
return new Intl.NumberFormat(locale).format(value)
|
|
}
|
|
|
|
export function ButtonGroupNested() {
|
|
const context = useLanguageContext()
|
|
const lang = context?.language === "he" ? "he" : "ar"
|
|
const t = translations[lang]
|
|
|
|
return (
|
|
<ButtonGroup dir={t.dir}>
|
|
<ButtonGroup>
|
|
<Button variant="outline" size="sm">
|
|
{formatNumber(1, t.locale)}
|
|
</Button>
|
|
<Button variant="outline" size="sm">
|
|
{formatNumber(2, t.locale)}
|
|
</Button>
|
|
<Button variant="outline" size="sm">
|
|
{formatNumber(3, t.locale)}
|
|
</Button>
|
|
</ButtonGroup>
|
|
<ButtonGroup>
|
|
<Button variant="outline" size="icon-sm" aria-label={t.previous}>
|
|
<ArrowLeftIcon className="rtl:rotate-180" />
|
|
</Button>
|
|
<Button variant="outline" size="icon-sm" aria-label={t.next}>
|
|
<ArrowRightIcon className="rtl:rotate-180" />
|
|
</Button>
|
|
</ButtonGroup>
|
|
</ButtonGroup>
|
|
)
|
|
}
|