fix: build errors
This commit is contained in:
@@ -17,11 +17,11 @@ import { Switch } from "@/components/ui/switch";
|
||||
import { TicketPercentIcon } from "lucide-react";
|
||||
import { MedalStar } from 'iconsax-react'
|
||||
import { useQueryState } from 'next-usequerystate'
|
||||
import ComboBox, { DropdownOption } from "@/components/combobox/ComboBox";
|
||||
import clsx from "clsx";
|
||||
import CategorySmallItemRenderer from "@/components/listview/CategorySmallItemRenderer";
|
||||
import { motion } from "framer-motion";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import ComboBox, { ComboboxOption } from "@/components/combobox/Combobox";
|
||||
|
||||
const categories = new Array(13).fill({ title: "خوراک", icon: "" });
|
||||
|
||||
@@ -139,12 +139,12 @@ const MenuIndex = () => {
|
||||
const { t: tMenu } = useTranslation('menu', {
|
||||
keyPrefix: "Menu"
|
||||
});
|
||||
const contents: Array<DropdownOption> = [
|
||||
const contents: Array<ComboboxOption> = [
|
||||
{ id: '0', title: tMenu('MenuFilterDrawer.SelectContent.Options.Normal'), label: '' },
|
||||
{ id: '1', title: tMenu('MenuFilterDrawer.SelectContent.Options.Vegan'), label: '' },
|
||||
]
|
||||
|
||||
const shippings: Array<DropdownOption> = [
|
||||
const shippings: Array<ComboboxOption> = [
|
||||
{ id: '0', title: tMenu('MenuFilterDrawer.SelectDelivery.Options.Courier'), label: '' },
|
||||
]
|
||||
|
||||
|
||||
@@ -1,9 +1,18 @@
|
||||
import 'server-only'
|
||||
|
||||
|
||||
const dictionaries = {
|
||||
en: () => import('@/dictionaries/en.json').then((module) => module.default),
|
||||
fa: () => import('@/dictionaries/fa.json').then((module) => module.default),
|
||||
fa: (namespace: string) => import(`@/dictionaries/fa/${namespace}.json`).then((module) => module.default),
|
||||
en: (namespace: string) => import(`@/dictionaries/en/${namespace}.json`).then((module) => module.default),
|
||||
}
|
||||
|
||||
export const getDictionary = async (
|
||||
locale: 'en' | 'fa',
|
||||
namespace: 'common' | 'module'
|
||||
) => {
|
||||
try {
|
||||
return await dictionaries[locale](namespace)
|
||||
} catch (error) {
|
||||
console.error(`Failed to load ${locale}/${namespace}.json`, error)
|
||||
return {}
|
||||
}
|
||||
}
|
||||
|
||||
export const getDictionary = async (locale: 'en' | 'fa') =>
|
||||
dictionaries[locale]()
|
||||
@@ -18,7 +18,7 @@ export default async function RootLayout({
|
||||
params,
|
||||
}: Readonly<{
|
||||
children: React.ReactNode;
|
||||
params: { locale: string }
|
||||
params: Promise<{ locale: string }>
|
||||
}>) {
|
||||
const { locale } = await params;
|
||||
if (!i18nConfig.locales.includes(locale)) {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import Button from '@/components/button/PrimaryButton';
|
||||
import { Button as ShadButton } from '@/components/ui/button';
|
||||
import ComboBox from '@/components/combobox/ComboBox';
|
||||
import ComboBox from '@/components/combobox/Combobox';
|
||||
import InputField from '@/components/input/InputField';
|
||||
import { PORFILE_EDIT_PAGE_ELEMENT } from '@/enums';
|
||||
import { Popover, PopoverTrigger, PopoverContent } from '@radix-ui/react-popover';
|
||||
|
||||
Reference in New Issue
Block a user