"use client";
import { useState } from "react";
import Image from "next/image";
import { Button } from "@repo/shared-components";
import MDEditor from "@uiw/react-md-editor";
import { RefreshCw } from "lucide-react";
import { updateChangelogAck } from "./ChangelogActions";
export const ChangelogModal = ({
latestChangelog,
isOpen,
onClose,
}: {
latestChangelog: { title: string; text: string; previewImage: string } | null;
isOpen: boolean;
onClose: () => void;
}) => {
if (!isOpen || !latestChangelog) return null;
const handleClose = async () => {
onClose();
await updateChangelogAck();
};
return (
);
};
export const ChangelogBtn = ({
latestChangelog,
}: {
latestChangelog: { title: string; text: string; previewImage: string } | null;
}) => {
const [isOpen, setIsOpen] = useState(false);
if (!latestChangelog) return null;
return (
<>
setIsOpen(true)}
>
{latestChangelog.title}
setIsOpen(false)}
/>
>
);
};
export const OpenChangelogOnPageload = ({
latestChangelog,
}: {
latestChangelog: { title: string; text: string; previewImage: string } | null;
}) => {
const [isOpen, setIsOpen] = useState(true);
if (!latestChangelog) return null;
return (
<>
setIsOpen(false)}
/>
>
);
};