"use client"; import { useState, FC } from "react"; // ui import { IExportData } from "@plane/types"; import { Button } from "@plane/ui"; // helpers import { getDate, renderFormattedDate } from "@/helpers/date-time.helper"; // types type Props = { service: IExportData; refreshing: boolean; }; export const SingleExport: FC = ({ service, refreshing }) => { const provider = service.provider; // eslint-disable-next-line @typescript-eslint/no-unused-vars const [isLoading, setIsLoading] = useState(false); const checkExpiry = (inputDateString: string) => { const currentDate = new Date(); const expiryDate = getDate(inputDateString); if (!expiryDate) return false; expiryDate.setDate(expiryDate.getDate() + 7); return expiryDate > currentDate; }; return (

Export to{" "} {provider === "csv" ? "CSV" : provider === "xlsx" ? "Excel" : provider === "json" ? "JSON" : ""} {" "} {refreshing ? "Refreshing..." : service.status}

{renderFormattedDate(service.created_at)}| Exported by {service?.initiated_by_detail?.display_name}
{checkExpiry(service.created_at) ? ( <> {service.status == "completed" && (
)} ) : (
Expired
)}
); };