2025-03-09 09:32:51 +08:00
|
|
|
import { getCategories } from '~/apis/common/get-categories'
|
2025-02-20 22:20:27 +07:00
|
|
|
import { NewsCategoriesPage } from '~/pages/news-categories'
|
|
|
|
|
|
2025-03-09 09:32:51 +08:00
|
|
|
import type { Route } from './+types/_news.category.$code'
|
|
|
|
|
|
|
|
|
|
export const loader = async ({ params }: Route.LoaderArgs) => {
|
|
|
|
|
const { data: categoriesData } = await getCategories()
|
|
|
|
|
const categoryData = categoriesData.find(
|
2025-03-09 09:50:18 +08:00
|
|
|
(category) => category.code === params.code,
|
2025-03-09 09:32:51 +08:00
|
|
|
)
|
|
|
|
|
return { categoryData }
|
|
|
|
|
}
|
|
|
|
|
|
2025-03-03 16:33:30 +08:00
|
|
|
const NewsCategoriesLayout = () => <NewsCategoriesPage />
|
2025-02-20 22:20:27 +07:00
|
|
|
|
|
|
|
|
export default NewsCategoriesLayout
|