@@ -1,17 +1,17 @@
|
||||
'use client';
|
||||
"use client";
|
||||
|
||||
import React, { useTransition } from 'react';
|
||||
import { Locale, useLocale } from 'next-intl';
|
||||
import React, { useTransition } from "react";
|
||||
import { Locale, useLocale } from "next-intl";
|
||||
import {
|
||||
SelectContent,
|
||||
SelectItem,
|
||||
SelectRoot,
|
||||
SelectTrigger,
|
||||
SelectValueText,
|
||||
} from '@/components/ui/collections/select';
|
||||
import { useParams } from 'next/navigation';
|
||||
import { createListCollection, ClientOnly } from '@chakra-ui/react';
|
||||
import { usePathname, useRouter } from '@/i18n/navigation';
|
||||
} from "@/components/ui/collections/select";
|
||||
import { useParams } from "next/navigation";
|
||||
import { createListCollection, ClientOnly } from "@chakra-ui/react";
|
||||
import { usePathname, useRouter } from "@/i18n/navigation";
|
||||
|
||||
const LocaleSwitcher = () => {
|
||||
const locale = useLocale();
|
||||
@@ -22,8 +22,8 @@ const LocaleSwitcher = () => {
|
||||
|
||||
const collections = createListCollection({
|
||||
items: [
|
||||
{ label: 'English', value: 'en' },
|
||||
{ label: 'Türkçe', value: 'tr' },
|
||||
{ label: "English", value: "en" },
|
||||
{ label: "Türkçe", value: "tr" },
|
||||
],
|
||||
});
|
||||
|
||||
@@ -40,21 +40,21 @@ const LocaleSwitcher = () => {
|
||||
});
|
||||
}
|
||||
return (
|
||||
<ClientOnly fallback={<div style={{ height: '32px' }} />}>
|
||||
<ClientOnly fallback={<div style={{ height: "32px" }} />}>
|
||||
<SelectRoot
|
||||
disabled={isPending}
|
||||
value={[locale]}
|
||||
onValueChange={onSelectChange}
|
||||
w={{ base: 'full', lg: '24' }}
|
||||
size='sm'
|
||||
variant='outline'
|
||||
borderRadius='md'
|
||||
w={{ base: "full", lg: "24" }}
|
||||
size="sm"
|
||||
variant="outline"
|
||||
borderRadius="md"
|
||||
collection={collections}
|
||||
>
|
||||
<SelectTrigger>
|
||||
<SelectValueText placeholder='Select a language' />
|
||||
<SelectValueText placeholder="Select a language" />
|
||||
</SelectTrigger>
|
||||
<SelectContent zIndex='9999'>
|
||||
<SelectContent zIndex="9999">
|
||||
{collections.items.map((collection) => (
|
||||
<SelectItem key={collection.value} item={collection}>
|
||||
{collection.label}
|
||||
|
||||
Reference in New Issue
Block a user