Files
upstream-shadcn-ui/apps/v4/examples/base/native-select-rtl.tsx
upstream-mirror 1416db152c
All checks were successful
Release / Create Version PR or Publish Stable Release (push) Has been skipped
Release / Publish Prerelease to NPM (push) Has been skipped
Monitor Registries / Monitor registry health (push) Has been skipped
snapshot of https://github.com/shadcn-ui/ui.git (main, 2026-09-15; blobs > 131072B omitted)
2026-09-15 22:44:43 +05:00

62 lines
1.4 KiB
TypeScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"use client"
import * as React from "react"
import {
useTranslation,
type Translations,
} from "@/components/language-selector"
import {
NativeSelect,
NativeSelectOption,
} from "@/styles/base-nova/ui-rtl/native-select"
const translations: Translations = {
en: {
dir: "ltr",
values: {
placeholder: "Select status",
todo: "Todo",
inProgress: "In Progress",
done: "Done",
cancelled: "Cancelled",
},
},
ar: {
dir: "rtl",
values: {
placeholder: "اختر الحالة",
todo: "مهام",
inProgress: "قيد التنفيذ",
done: "منجز",
cancelled: "ملغي",
},
},
he: {
dir: "rtl",
values: {
placeholder: "בחר סטטוס",
todo: "לעשות",
inProgress: "בתהליך",
done: "הושלם",
cancelled: "בוטל",
},
},
}
export function NativeSelectRtl() {
const { dir, t } = useTranslation(translations, "ar")
return (
<NativeSelect dir={dir}>
<NativeSelectOption value="">{t.placeholder}</NativeSelectOption>
<NativeSelectOption value="todo">{t.todo}</NativeSelectOption>
<NativeSelectOption value="in-progress">
{t.inProgress}
</NativeSelectOption>
<NativeSelectOption value="done">{t.done}</NativeSelectOption>
<NativeSelectOption value="cancelled">{t.cancelled}</NativeSelectOption>
</NativeSelect>
)
}