mirror of
https://github.com/shadcn-ui/ui.git
synced 2026-06-29 07:34:11 +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
56 lines
1.4 KiB
TypeScript
56 lines
1.4 KiB
TypeScript
"use client"
|
|
|
|
import * as React from "react"
|
|
import {
|
|
Field,
|
|
FieldDescription,
|
|
FieldLabel,
|
|
} from "@/examples/base/ui-rtl/field"
|
|
import { Textarea } from "@/examples/base/ui-rtl/textarea"
|
|
|
|
import {
|
|
useTranslation,
|
|
type Translations,
|
|
} from "@/components/language-selector"
|
|
|
|
const translations: Translations = {
|
|
en: {
|
|
dir: "ltr",
|
|
values: {
|
|
label: "Feedback",
|
|
placeholder: "Your feedback helps us improve...",
|
|
description: "Share your thoughts about our service.",
|
|
},
|
|
},
|
|
ar: {
|
|
dir: "rtl",
|
|
values: {
|
|
label: "التعليقات",
|
|
placeholder: "تعليقاتك تساعدنا على التحسين...",
|
|
description: "شاركنا أفكارك حول خدمتنا.",
|
|
},
|
|
},
|
|
he: {
|
|
dir: "rtl",
|
|
values: {
|
|
label: "משוב",
|
|
placeholder: "המשוב שלך עוזר לנו להשתפר...",
|
|
description: "שתף את מחשבותיך על השירות שלנו.",
|
|
},
|
|
},
|
|
}
|
|
|
|
export default function TextareaRtl() {
|
|
const { dir, t } = useTranslation(translations, "ar")
|
|
|
|
return (
|
|
<Field className="w-full max-w-xs" dir={dir}>
|
|
<FieldLabel htmlFor="feedback" dir={dir}>
|
|
{t.label}
|
|
</FieldLabel>
|
|
<Textarea id="feedback" placeholder={t.placeholder} dir={dir} rows={4} />
|
|
<FieldDescription dir={dir}>{t.description}</FieldDescription>
|
|
</Field>
|
|
)
|
|
}
|