{t('title')}
-{t('title')}
+{t('tooltips.viewShoppingCart')}
+New item page
; -} diff --git a/src/app/[locale]/(default)/storage/page.tsx b/src/app/[locale]/(default)/storage/page.tsx new file mode 100644 index 0000000..223f604 --- /dev/null +++ b/src/app/[locale]/(default)/storage/page.tsx @@ -0,0 +1,156 @@ +import { PaginationCarousel } from '@/components/layout/PaginationCarousel'; +import { Button } from '@/components/ui/Button'; +import { + Card, + CardDescription, + CardFooter, + CardHeader, + CardTitle, +} from '@/components/ui/Card'; +import { Combobox } from '@/components/ui/Combobox'; +import { SearchBar } from '@/components/ui/SearchBar'; +import { + Select, + SelectContent, + SelectItem, + SelectTrigger, + SelectValue, +} from '@/components/ui/Select'; +import { items } from '@/mock-data/items'; +import { useTranslations } from 'next-intl'; +import { getTranslations, unstable_setRequestLocale } from 'next-intl/server'; +import Image from 'next/image'; +import { createSearchParamsCache, parseAsInteger } from 'nuqs/server'; + +export async function generateMetadata({ + params: { locale }, +}: { + params: { locale: string }; +}) { + const t = await getTranslations({ locale, namespace: 'layout' }); + + return { + title: t('storage'), + }; +} + +export default function StoragePage({ + params: { locale }, + searchParams, +}: { + params: { locale: string }; + searchParams: Record- {t('title')} -
- -- {t('error')} -
-- {t('errorDescription')} -
- {error.message && ( -- Error: {error.message} -
- )} -- {t('notFound')} -
-- {t('notFoundDescription')} -
- -- {t('card.quantityInfo', { quantity: item.quantity })} -
-{t.viewShoppingCart}
-{t.cartEmpty}
; - } - - const itemsInCart = items.filter((item) => - cart.some((cartItem) => cartItem.id === item.id), - ); - - function updateAmountInCart(id: number, newValue: number) { - if (!cart) return; - - const newCart = cart.map((cartItem) => - cartItem.id === id ? { ...cartItem, amount: newValue } : cartItem, - ); - setCart(newCart); - } - - function removeItem(id: number) { - if (!cart) return; - - const newCart = cart.filter((cartItem: CartItem) => cartItem.id !== id); - setCart(newCart); - } - - return ( -- {body} -
- ); -}); -FormMessage.displayName = 'FormMessage'; - -export { - useFormField, - Form, - FormItem, - FormLabel, - FormControl, - FormDescription, - FormMessage, - FormField, -}; diff --git a/src/components/ui/Input.tsx b/src/components/ui/Input.tsx index 18d6b46..a16957e 100644 --- a/src/components/ui/Input.tsx +++ b/src/components/ui/Input.tsx @@ -10,7 +10,7 @@ const Input = React.forwardRef