Don't render locale selector when there are no options (#27141)

Closes #27140

Signed-off-by: Peter Keuter <github@peterkeuter.nl>
This commit is contained in:
Peter Keuter 2024-02-19 17:57:39 +01:00 committed by GitHub
parent f7e60b4338
commit 110b8714ab
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -23,7 +23,9 @@ export const LocaleSelector = ({
key: locale, key: locale,
value: localeToDisplayName(locale) || "", value: localeToDisplayName(locale) || "",
})); }));
if (!locales.length) {
return null;
}
return ( return (
<FormProvider {...form}> <FormProvider {...form}>
<SelectControl <SelectControl