Files
bewell-in-ua/components/temp-component.tsx
2025-02-05 09:02:03 +02:00

32 lines
613 B
TypeScript

'use client'
import {useLocale} from 'next-intl'
import {Link} from '@/i18n/routing'
export default function TempComponent(data: {data: object[]}) {
const locale = useLocale()
/*console.log(data)*/
const items = data?.data as object[]
return (
<>
<code>{locale}</code>
{/*<pre>{JSON.stringify(data, null, 2)}</pre>*/}
<pre>
{items.map((item: any) => (
<div key={item.id}>
<Link
href={`/category/${item.id}-${item.locales[locale === 'uk' ? 0 : 1].slug}`}
>
{item.locales[locale === 'uk' ? 0 : 1].title}
</Link>
</div>
))}
</pre>
</>
)
}