Improved Changelog, Changelog in Dispatch

This commit is contained in:
PxlLoewe
2025-07-24 15:44:34 -07:00
parent 08c4cfe082
commit a5c4a1dc7c
17 changed files with 215 additions and 177 deletions

View File

@@ -0,0 +1,26 @@
"use client";
import { updateUser } from "(app)/settings/actions";
import { Changelog } from "@repo/db";
import { ChangelogModalBtn } from "@repo/shared-components";
import { useSession } from "next-auth/react";
import toast from "react-hot-toast";
export const ChangelogWrapper = ({ latestChangelog }: { latestChangelog: Changelog | null }) => {
const { data: session } = useSession();
const autoOpen = !session?.user.changelogAck && !!latestChangelog;
if (!latestChangelog) return null;
return (
<ChangelogModalBtn
latestChangelog={latestChangelog}
autoOpen={autoOpen}
onClose={async () => {
await updateUser({ changelogAck: true });
if (!session?.user.changelogAck) {
toast.success("Changelog als gelesen markiert");
}
}}
/>
);
};