"use client" import * as React from "react" import { useTranslation, type Translations, } from "@/components/language-selector" import { Combobox, ComboboxChip, ComboboxChips, ComboboxChipsInput, ComboboxContent, ComboboxEmpty, ComboboxItem, ComboboxList, ComboboxValue, useComboboxAnchor, } from "@/styles/base-nova/ui-rtl/combobox" import { Field, FieldLabel } from "@/styles/base-nova/ui-rtl/field" const categories = [ "technology", "design", "business", "marketing", "education", "health", ] as const const translations: Translations = { en: { dir: "ltr", values: { label: "Categories", placeholder: "Add categories", empty: "No categories found.", technology: "Technology", design: "Design", business: "Business", marketing: "Marketing", education: "Education", health: "Health", }, }, ar: { dir: "rtl", values: { label: "الفئات", placeholder: "أضف فئات", empty: "لم يتم العثور على فئات.", technology: "التكنولوجيا", design: "التصميم", business: "الأعمال", marketing: "التسويق", education: "التعليم", health: "الصحة", }, }, he: { dir: "rtl", values: { label: "קטגוריות", placeholder: "הוסף קטגוריות", empty: "לא נמצאו קטגוריות.", technology: "טכנולוגיה", design: "עיצוב", business: "עסקים", marketing: "שיווק", education: "חינוך", health: "בריאות", }, }, } export function ComboboxRtl() { const { dir, t, language } = useTranslation(translations, "ar") const anchor = useComboboxAnchor() const categoryLabels: Record = { technology: t.technology, design: t.design, business: t.business, marketing: t.marketing, education: t.education, health: t.health, } return ( {t.label} categoryLabels[item] || item } > {(values) => ( {values.map((value: string) => ( {categoryLabels[value] || value} ))} )} {t.empty} {(item) => ( {categoryLabels[item] || item} )} ) }