import React from "react"; import useSWR from "swr"; // headless ui import { Dialog, Transition } from "@headlessui/react"; // component import { MarkdownRenderer, Spinner } from "components/ui"; // icons import { XMarkIcon } from "@heroicons/react/20/solid"; // services import workspaceService from "services/workspace.service"; // helper import { renderLongDateFormat } from "helpers/date-time.helper"; type Props = { isOpen: boolean; setIsOpen: React.Dispatch>; }; export const ProductUpdatesModal: React.FC = ({ isOpen, setIsOpen }) => { const { data: updates } = useSWR("PRODUCT_UPDATES", () => workspaceService.getProductUpdates()); return (
Product Updates {updates && updates.length > 0 ? ( updates.map((item: any, index: number) => ( <>
{item.tag_name} {renderLongDateFormat(item.published_at)} {index === 0 && ( New )}
)) ) : (
Loading...
)}
); };