import htmlParse from 'html-react-parser' import { useRouteLoaderData } from 'react-router' import type { TTagResponse } from '~/apis/common/get-tags' import { Card } from '~/components/ui/card' import { CarouselSection } from '~/components/ui/carousel-section' import { IconsSocial } from '~/components/ui/social-share' import { BERITA } from '~/data/contents' import type { loader } from '~/routes/_news.detail.$slug' import { formatDate } from '~/utils/formatter' export const NewsDetailPage = () => { const loaderData = useRouteLoaderData( 'routes/_news.detail.$slug', ) // eslint-disable-next-line @typescript-eslint/no-explicit-any const { newsDetailData }: any = loaderData const { title, content, featured_image, slug, author, live_at, tags } = newsDetailData return ( {title} {/* next planing create component for this section */} {author.name} {formatDate(live_at)} . 5 min read {/* end next planing create component for this section */} {htmlParse(content)} Share this post {tags?.map((tag: TTagResponse) => ( {tag.name} ))} ) }
{formatDate(live_at)} . 5 min read
Share this post