import type { Metadata } from "next" import { getTranslations, getMessages, setRequestLocale } from "next-intl/server" import { Link } from "@/i18n/navigation" import Image from "next/image" import { DocHeader } from "@/components/ui/doc-header" import { Callout } from "@/components/ui/callout" import { DataFlowDiagram } from "@/components/ui/data-flow-diagram" import CopyableCode from "@/components/CopyableCode" export async function generateMetadata({ params, }: { params: Promise<{ locale: string }> }): Promise { const { locale } = await params const t = await getTranslations({ locale, namespace: "docs.utils.systemUpdate.meta" }) return { title: t("title"), description: t("description"), openGraph: { title: t("ogTitle"), description: t("ogDescription"), type: "article", url: "https://macrimi.github.io/ProxMenux/docs/utils/system-update", }, } } type StringItem = string type TroubleItem = { title: string; body: string } type RelatedItem = { href: string; label: string; tail?: string } export default async function SystemUpdatePage({ params, }: { params: Promise<{ locale: string }> }) { const { locale } = await params setRequestLocale(locale) const t = await getTranslations({ locale, namespace: "docs.utils.systemUpdate" }) const messages = (await getMessages({ locale })) as unknown as { docs: { utils: { systemUpdate: { onTop: { items: StringItem[] } worker: { items: StringItem[] } post: { items: StringItem[] } noSub: { items: StringItem[] } doesnt: { items: StringItem[] } troubleshooting: { items: TroubleItem[] } related: { items: RelatedItem[] } } } } } const block = messages.docs.utils.systemUpdate const onTopItems = block.onTop.items const workerItems = block.worker.items const postItems = block.post.items const noSubItems = block.noSub.items const doesntItems = block.doesnt.items const troubleItems = block.troubleshooting.items const relatedItems = block.related.items const code = (chunks: React.ReactNode) => {chunks} const strong = (chunks: React.ReactNode) => {chunks} const em = (chunks: React.ReactNode) => {chunks} const kbd = (chunks: React.ReactNode) => {chunks} const linkUpgrade = (chunks: React.ReactNode) => ( {chunks} ) const linkUpgrade2 = (chunks: React.ReactNode) => ( {chunks} ) return (
{t.rich("calloutWhat.body", { strong, link: linkUpgrade })}

{t("official.heading")}

{t("official.intro")}

{t("official.outro")}

{t("onTop.heading")}

{t.rich("onTop.intro", { strong, code })}

    {onTopItems.map((_, idx) => (
  • {t.rich(`onTop.items.${idx}`, { strong, code })}
  • ))}
{t("calloutOneSentence.body")}

{t("confirm.heading")}

{t("confirm.intro")}

{t("confirm.imageAlt")}

{t("routes.heading")}

{t("worker.heading")}

{t.rich("worker.intro", { code })}

    {workerItems.map((_, idx) => (
  1. {t.rich(`worker.items.${idx}`, { strong, code })}
  2. ))}

{t("post.heading")}

{t("post.intro")}

{t.raw("post.code") as string}

{t("post.afterCode")}

    {postItems.map((_, idx) => (
  • {t.rich(`post.items.${idx}`, { code })}
  • ))}

{t.rich("post.outro", { em })}

{t("end.heading")}

{t("end.intro")}

{t("end.imageAlt")} {t.rich("calloutDeclineReboot.body", { code })}

{t("noSub.heading")}

{t.rich("noSub.intro", { code })}

    {noSubItems.map((_, idx) => (
  1. {t.rich(`noSub.items.${idx}`, { code })}
  2. ))}

{t("noSub.outro")}

{t("cluster.heading")}

{t.rich("cluster.calloutBody", { strong })}

{t("doesnt.heading")}

    {doesntItems.map((_, idx) => (
  • {t.rich(`doesnt.items.${idx}`, { strong, link: linkUpgrade2 })}
  • ))}

{t("troubleshooting.heading")}

{troubleItems.map((_, idx) => ( {t.rich(`troubleshooting.items.${idx}.body`, { code, kbd })} ))}

{t("files.heading")}

{t.raw("files.code") as string}

{t("related.heading")}

    {relatedItems.map((item, idx) => (
  • {item.label} {item.tail}
  • ))}
) }