import { useState, FC } from "react"; // ui import { Button } from "@plane/ui"; // helpers import { renderShortDateWithYearFormat } from "helpers/date-time.helper"; // types import { IExportData } from "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 = new Date(inputDateString); expiryDate.setDate(expiryDate.getDate() + 7); return expiryDate > currentDate; }; return (

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

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