mirror of
https://github.com/vercel/commerce.git
synced 2025-07-22 20:26:49 +00:00
Restructured app to work better with localized slugs
This commit is contained in:
@@ -1,19 +1,12 @@
|
||||
'use client';
|
||||
|
||||
import { useTranslations } from 'next-intl';
|
||||
import Link from 'next/link';
|
||||
|
||||
export default function DesktopMenu({ items, locale }: { items: []; locale: string }) {
|
||||
const t = useTranslations('routes');
|
||||
export default function DesktopMenu({ items }: { items: []; locale: string }) {
|
||||
return (
|
||||
<ul className="flex gap-6">
|
||||
{items.map((item: { title: string; slug: string }, i: number) => {
|
||||
return (
|
||||
<li key={i}>
|
||||
<Link
|
||||
className="font-medium underline-offset-2 hover:underline"
|
||||
href={`/${locale}/${t('category')}/${item.slug}`}
|
||||
>
|
||||
<Link className="font-medium underline-offset-2 hover:underline" href={`${item.slug}`}>
|
||||
{item.title}
|
||||
</Link>
|
||||
</li>
|
||||
|
Reference in New Issue
Block a user