dev, Dispatch + Pilot Settings
This commit is contained in:
@@ -5,13 +5,14 @@ import { Button } from "@repo/shared-components";
|
||||
import MDEditor from "@uiw/react-md-editor";
|
||||
import { RefreshCw } from "lucide-react";
|
||||
import { updateChangelogAck } from "./ChangelogActions";
|
||||
import { Changelog } from "@repo/db";
|
||||
|
||||
export const ChangelogModal = ({
|
||||
latestChangelog,
|
||||
isOpen,
|
||||
onClose,
|
||||
}: {
|
||||
latestChangelog: { title: string; text: string; previewImage: string } | null;
|
||||
latestChangelog: Changelog | null;
|
||||
isOpen: boolean;
|
||||
onClose: () => void;
|
||||
}) => {
|
||||
@@ -79,11 +80,7 @@ export const ChangelogModal = ({
|
||||
);
|
||||
};
|
||||
|
||||
export const ChangelogBtn = ({
|
||||
latestChangelog,
|
||||
}: {
|
||||
latestChangelog: { title: string; text: string; previewImage: string } | null;
|
||||
}) => {
|
||||
export const ChangelogBtn = ({ latestChangelog }: { latestChangelog: Changelog | null }) => {
|
||||
const [isOpen, setIsOpen] = useState(false);
|
||||
|
||||
if (!latestChangelog) return null;
|
||||
@@ -109,7 +106,7 @@ export const ChangelogBtn = ({
|
||||
export const OpenChangelogOnPageload = ({
|
||||
latestChangelog,
|
||||
}: {
|
||||
latestChangelog: { title: string; text: string; previewImage: string } | null;
|
||||
latestChangelog: Changelog | null;
|
||||
}) => {
|
||||
const [isOpen, setIsOpen] = useState(true);
|
||||
|
||||
|
||||
@@ -12,11 +12,7 @@ export async function getLatestChangelog() {
|
||||
});
|
||||
|
||||
if (latestChangelog.length > 0 && latestChangelog[0]) {
|
||||
return {
|
||||
title: latestChangelog[0].title,
|
||||
text: latestChangelog[0].text,
|
||||
previewImage: latestChangelog[0].previewImage || "",
|
||||
};
|
||||
return latestChangelog[0];
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user