"use client"; import { Button } from "./ui/button"; import { Badge } from "./ui/badge"; import { X, ExternalLink, Calendar, Tag, AlertTriangle } from "lucide-react"; import { useRegisterModal } from "./modal/ModalStackProvider"; import ReactMarkdown from "react-markdown"; import remarkGfm from "remark-gfm"; interface UpdateConfirmationModalProps { isOpen: boolean; onClose: () => void; onConfirm: () => void; releaseInfo: { tagName: string; name: string; publishedAt: string; htmlUrl: string; body?: string; } | null; currentVersion: string; latestVersion: string; } export function UpdateConfirmationModal({ isOpen, onClose, onConfirm, releaseInfo, currentVersion, latestVersion, }: UpdateConfirmationModalProps) { useRegisterModal(isOpen, { id: "update-confirmation-modal", allowEscape: true, onClose, }); if (!isOpen || !releaseInfo) return null; return (
{/* Header */}

Confirm Update

Review the changelog before proceeding with the update

{/* Content */}
{/* Version Info */}

{releaseInfo.name || releaseInfo.tagName}

Latest
{releaseInfo.tagName}
{new Date(releaseInfo.publishedAt).toLocaleDateString( "en-US", { year: "numeric", month: "long", day: "numeric", }, )}
Updating from v{currentVersion} to v{latestVersion}
{/* Changelog */} {releaseInfo.body ? (

Changelog

(

{children}

), h2: ({ children }) => (

{children}

), h3: ({ children }) => (

{children}

), p: ({ children }) => (

{children}

), ul: ({ children }) => (
    {children}
), ol: ({ children }) => (
    {children}
), li: ({ children }) => (
  • {children}
  • ), a: ({ href, children }) => ( {children} ), strong: ({ children }) => ( {children} ), em: ({ children }) => ( {children} ), }} > {releaseInfo.body}
    ) : (

    No changelog available for this release.

    )} {/* Warning */}

    Important:

    Please review the changelog above for any breaking changes or important updates before proceeding. The server will restart automatically after the update completes.

    {/* Footer */}
    ); }