mirror of
https://github.com/shadcn-ui/ui.git
synced 2026-06-23 04:35:46 +00:00
* feat: rtl * feat * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * feat: add sidebar * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * chore: changeset * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix
62 lines
1.4 KiB
TypeScript
62 lines
1.4 KiB
TypeScript
"use client"
|
|
|
|
import { Button } from "@/examples/base/ui-rtl/button"
|
|
import { Spinner } from "@/examples/base/ui-rtl/spinner"
|
|
import { ArrowRightIcon, PlusIcon } from "lucide-react"
|
|
|
|
import {
|
|
useTranslation,
|
|
type Translations,
|
|
} from "@/components/language-selector"
|
|
|
|
const translations: Translations = {
|
|
en: {
|
|
dir: "ltr",
|
|
values: {
|
|
button: "Button",
|
|
submit: "Submit",
|
|
delete: "Delete",
|
|
loading: "Loading",
|
|
},
|
|
},
|
|
ar: {
|
|
dir: "rtl",
|
|
values: {
|
|
button: "زر",
|
|
submit: "إرسال",
|
|
delete: "حذف",
|
|
loading: "جاري التحميل",
|
|
},
|
|
},
|
|
he: {
|
|
dir: "rtl",
|
|
values: {
|
|
button: "כפתור",
|
|
submit: "שלח",
|
|
delete: "מחק",
|
|
loading: "טוען",
|
|
},
|
|
},
|
|
}
|
|
|
|
export function ButtonRtl() {
|
|
const { dir, t } = useTranslation(translations, "ar")
|
|
|
|
return (
|
|
<div className="flex flex-wrap items-center gap-2 md:flex-row" dir={dir}>
|
|
<Button variant="outline">{t.button}</Button>
|
|
<Button variant="destructive">{t.delete}</Button>
|
|
<Button variant="outline">
|
|
{t.submit}{" "}
|
|
<ArrowRightIcon className="rtl:rotate-180" data-icon="inline-end" />
|
|
</Button>
|
|
<Button variant="outline" size="icon" aria-label="Add">
|
|
<PlusIcon />
|
|
</Button>
|
|
<Button variant="secondary" disabled>
|
|
<Spinner data-icon="inline-start" /> {t.loading}
|
|
</Button>
|
|
</div>
|
|
)
|
|
}
|