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
@@ -0,0 +1,16 @@
import { getNews } from '~/apis/admin/get-news'
import { handleCookie } from '~/libs/cookies'
import { ContentsPage } from '~/pages/dashboard-contents'
import type { Route } from './+types/_admin.lg-admin._dashboard.contents._index'
export const loader = async ({ request }: Route.LoaderArgs) => {
const { staffToken } = await handleCookie(request)
const { data: newsData } = await getNews({
accessToken: staffToken,
})
return { newsData }
}
const DashboardContentsIndexLayout = () => <ContentsPage />
export default DashboardContentsIndexLayout