"use client"; import { Fragment, useEffect, useState } from "react"; import { Dialog, DialogContent, DialogHeader, DialogTrigger, } from "../ui/dialog"; import { getDataApprovalHistory } from "@/service/curated-content/curated-content"; import { ChevronRightIcon } from "lucide-react"; export default function ApprovalHistoryModal(props: { id: number }) { const { id } = props; const [history, setHistory] = useState([]); useEffect(() => { getApprovalHistory(); }, []); const getApprovalHistory = async () => { const res = await getDataApprovalHistory(id); console.log("res hstro", res?.data?.data); if (res?.data?.data) { setHistory(res?.data?.data); } }; return ( Lihat Riwayat Approval

Upload

{history?.length && history?.map((list: any, index: number) => ( {" "}

{list.status.name}

Level: {list.levelNumber}

Direview oleh: {list.approvalBy.fullname}

Catatan :

{list.message}

{index !== history.length - 1 && (

)}
))} {history.length > 0 && history[history.length - 1].status.id == 2 && ( <>

Publish

)}
); }