diff --git a/src/components/input/LanguageButton.tsx b/src/components/input/LanguageButton.tsx index bf5c9ff26..53fca3063 100644 --- a/src/components/input/LanguageButton.tsx +++ b/src/components/input/LanguageButton.tsx @@ -1,4 +1,4 @@ -import { Button, Dialog, Grid, Icon, MenuTrigger, Popover, Text } from '@umami/react-zen'; +import { Button, Dialog, DialogTrigger, Grid, Icon, Popover, Text } from '@umami/react-zen'; import { Globe } from 'lucide-react'; import { useLocale } from '@/components/hooks'; import { languages } from '@/lib/lang'; @@ -7,12 +7,13 @@ export function LanguageButton() { const { locale, saveLocale } = useLocale(); const items = Object.keys(languages).map(key => ({ ...languages[key], value: key })); - function handleSelect(value: string) { + function handleSelect(value: string, close: () => void) { saveLocale(value); + close(); } return ( - + - - {items.map(({ value, label }) => { - return ( - - ); - })} - + {({ close }) => ( + + {items.map(({ value, label }) => { + return ( + + ); + })} + + )} - + ); }