feat: add news and dashboard content routes with corresponding layouts
This commit is contained in:
@@ -3,14 +3,14 @@ import { useLocation, useRouteLoaderData } from 'react-router'
|
||||
import { Card } from '~/components/ui/card'
|
||||
import { CategorySection } from '~/components/ui/category-section'
|
||||
import { DUMMY_DESCRIPTION } from '~/data/contents'
|
||||
import type { loader } from '~/routes/_layout'
|
||||
import type { loader } from '~/routes/_news'
|
||||
|
||||
import { BERITA } from './data'
|
||||
|
||||
export const NewsCategoriesPage = () => {
|
||||
const { pathname } = useLocation()
|
||||
const code = pathname.split('/')[2]
|
||||
const loaderData = useRouteLoaderData<typeof loader>('routes/_layout')
|
||||
const loaderData = useRouteLoaderData<typeof loader>('routes/_news')
|
||||
const { name } =
|
||||
loaderData?.categoriesData.find((item) => item.code === code) || {}
|
||||
const { items } = BERITA
|
||||
|
||||
Reference in New Issue
Block a user