import React, { useEffect, useState } from "react"; import { formatDate } from "@/Utils"; export default function DetailModal(props) { const { isOpen, toggle = () => {}, booking = null, title } = props; const [data, setData] = useState({}); const handleCancel = () => { toggle(); }; useEffect(() => { setData({ booked: booking?.booked ? booking.booked : '', departure: booking?.departure ? formatDate(booking.departure).format('yyyy-MM-DD') : '', destination: booking?.destination ? booking.destination : '', flight_number: booking?.flight_number ? booking.flight_number : '', jumlah_koli: booking?.jumlah_koli ? booking.jumlah_koli : '', kemasan: booking?.kemasan ? booking.kemasan : '', master_awb: booking?.master_awb ? booking.master_awb : '', used: booking?.used ? booking.used : '', is_available: booking?.is_available ? booking.is_available : '', }) }, [booking]); return (

{title}

) };