added tons of features
This commit is contained in:
31
components/temp-component.tsx
Normal file
31
components/temp-component.tsx
Normal file
@@ -0,0 +1,31 @@
|
||||
'use client'
|
||||
|
||||
import {useLocale} from 'next-intl'
|
||||
|
||||
import {Link} from '@/i18n/routing'
|
||||
|
||||
export default function TempComponent(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>
|
||||
</>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user