feat(i18n) : add personal languages and compact weapon exports
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
"use client";
|
||||
|
||||
import { useTranslation } from "@/components/i18n/locale-provider";
|
||||
import { Children, type ReactNode, useState } from "react";
|
||||
|
||||
import { ScrollableNav } from "@/components/public/scrollable-nav";
|
||||
@@ -14,6 +15,7 @@ export function ConditionSwitcher({
|
||||
label?: string;
|
||||
labels?: readonly string[];
|
||||
}) {
|
||||
const { t, e } = useTranslation();
|
||||
const items = Children.toArray(children);
|
||||
const [active, setActive] = useState("0");
|
||||
|
||||
@@ -21,8 +23,8 @@ export function ConditionSwitcher({
|
||||
|
||||
return (
|
||||
<div className="flex min-w-0 flex-col gap-4">
|
||||
<ScrollableNav ariaLabel={label} className="w-full min-w-0">
|
||||
<ToggleGroup aria-label={label} variant="outline" value={[active]} onValueChange={(values) => {
|
||||
<ScrollableNav ariaLabel={t(label)} className="w-full min-w-0">
|
||||
<ToggleGroup aria-label={t(label)} variant="outline" value={[active]} onValueChange={(values) => {
|
||||
if (values[0]) setActive(values[0]);
|
||||
}}>
|
||||
{items.map((_, index) => (
|
||||
@@ -31,7 +33,7 @@ export function ConditionSwitcher({
|
||||
value={String(index)}
|
||||
className="aria-pressed:bg-primary aria-pressed:text-primary-foreground"
|
||||
>
|
||||
{labels?.[index] || `Condition ${index + 1}`}
|
||||
{labels?.[index] || e("condition", { index: index + 1 })}
|
||||
</ToggleGroupItem>
|
||||
))}
|
||||
</ToggleGroup>
|
||||
|
||||
Reference in New Issue
Block a user