dev, Dispatch + Pilot Settings

This commit is contained in:
PxlLoewe
2025-07-24 14:53:40 -07:00
parent 3c5b86eb41
commit 08c4cfe082
9 changed files with 268 additions and 31 deletions

View File

@@ -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);

View File

@@ -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;