feat: implement clientLoader for news data fetching and update serverLoader structure
This commit is contained in:
@@ -4,11 +4,13 @@ import { Card } from '~/components/ui/card'
|
||||
import { CarouselHero } from '~/components/ui/carousel-hero'
|
||||
import { CarouselSection } from '~/components/ui/carousel-section'
|
||||
import { Newsletter } from '~/components/ui/newsletter'
|
||||
import type { loader } from '~/routes/_news._index'
|
||||
import { type clientLoader } from '~/routes/_news._index'
|
||||
import type { TNews } from '~/types/news'
|
||||
|
||||
export const NewsPage = () => {
|
||||
const loaderData = useRouteLoaderData<typeof loader>('routes/_news._index')
|
||||
const loaderData = useRouteLoaderData<typeof clientLoader>(
|
||||
'routes/_news._index',
|
||||
)
|
||||
const spotlight: TNews = {
|
||||
title: loaderData?.spotlightCategory?.name || '',
|
||||
description: loaderData?.spotlightCategory?.description || '',
|
||||
|
||||
Reference in New Issue
Block a user