"use client"; import React, { useEffect, useState } from "react"; import DetailNews from "../../page/detail-news"; import SidebarDetail from "../../page/sidebar-detail"; import RelatedNews from "../../page/related-news"; import Comment from "./comment"; import { getArticleById } from "@/service/article"; import { useParams } from "next/navigation"; export default function NewsDetailPage() { const params = useParams(); const id = params.id; const [detailArticle, setDetailArticle] = useState(); useEffect(() => { initFetch(); }, []); const initFetch = async () => { const res = await getArticleById(id); const data = res?.data?.data; setDetailArticle(data); }; return ( <>
); }