import { html } from '@webjsdev/core';
const translations = {
en: {
dir: 'ltr',
values: {
list: 'List',
grid: 'Grid',
cards: 'Cards',
},
},
ar: {
dir: 'rtl',
values: {
list: 'قائمة',
grid: 'شبكة',
cards: 'بطاقات',
},
},
he: {
dir: 'rtl',
values: {
list: 'רשימה',
grid: 'רשת',
cards: 'כרטיסים',
},
},
};
// The provider is the dir attribute: the group styles itself with logical
// properties, so dir="rtl" on it flips the item order.
export default function ToggleGroupRtl() {
const lang = 'ar';
const { dir, values: t } = translations[lang];
return html`
${t.list}
${t.grid}
${t.cards}
`;
}