feat(web): app shell with sidebar nav, language switch, sign out
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import { useLocale } from "../i18n/use-locale";
|
||||
|
||||
export function LangSwitch() {
|
||||
const { locale, setLocale } = useLocale();
|
||||
const base = locale.startsWith("sv") ? "sv" : "en";
|
||||
|
||||
return (
|
||||
<div className="flex gap-1 text-xs">
|
||||
{(["sv", "en"] as const).map((lng) => (
|
||||
<button
|
||||
key={lng}
|
||||
onClick={() => setLocale(lng)}
|
||||
aria-pressed={base === lng}
|
||||
className={base === lng ? "font-bold" : "text-neutral-400"}
|
||||
>
|
||||
{lng.toUpperCase()}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user