refactor: enhance news handling and improve content display in various components
This commit is contained in:
@@ -4,14 +4,12 @@ import { Card } from '~/components/ui/card'
|
||||
import { CategorySection } from '~/components/ui/category-section'
|
||||
import type { loader } from '~/routes/_news.category.$code'
|
||||
|
||||
import { BERITA } from './data'
|
||||
|
||||
export const NewsCategoriesPage = () => {
|
||||
const loaderData = useRouteLoaderData<typeof loader>(
|
||||
'routes/_news.category.$code',
|
||||
)
|
||||
const { name, description } = loaderData?.categoryData || {}
|
||||
const { items } = BERITA
|
||||
const { categoryData, newsData } = loaderData || {}
|
||||
const { name, description } = categoryData || {}
|
||||
|
||||
return (
|
||||
<div className="relative">
|
||||
@@ -19,7 +17,7 @@ export const NewsCategoriesPage = () => {
|
||||
<CategorySection
|
||||
title={name || ''}
|
||||
description={description || ''}
|
||||
items={items}
|
||||
items={newsData || []}
|
||||
/>
|
||||
</Card>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user