feat: add news and dashboard content routes with corresponding layouts

This commit is contained in:
Ardeman
2025-03-07 12:11:48 +08:00
parent afebd8b335
commit 18098d63ba
22 changed files with 38 additions and 59 deletions
+2 -2
View File
@@ -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