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 { Steps } from "@/components/ui/steps" 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.postInstall.uninstall.meta" }) return { title: t("title"), description: t("description") } } type Step = { title: string body1: string body2?: string items?: string[] } type ReversibleItem = { tool: string; restores: string } type ReversibleGroup = { title: string; items: ReversibleItem[] } type RelatedItem = { label: string; href: string; tail: string } export default async function UninstallOptimizationsPage({ params, }: { params: Promise<{ locale: string }> }) { const { locale } = await params setRequestLocale(locale) const t = await getTranslations({ locale, namespace: "docs.postInstall.uninstall" }) const messages = (await getMessages({ locale })) as unknown as { docs: { postInstall: { uninstall: { howWorks: { steps: Step[] } reversible: { groups: ReversibleGroup[] } related: { items: RelatedItem[] } } } } } const steps = messages.docs.postInstall.uninstall.howWorks.steps const groups = messages.docs.postInstall.uninstall.reversible.groups const relatedItems = messages.docs.postInstall.uninstall.related.items const code = (chunks: React.ReactNode) => {chunks} const strong = (chunks: React.ReactNode) => {chunks} const em = (chunks: React.ReactNode) => {chunks} const postInstallLink = (chunks: React.ReactNode) => ( {chunks} ) return (
{t.rich("intro.body", { strong, code })}

{t("openMenu.heading")}

{t.rich("openMenu.body", { strong, em })}

{t("openMenu.imageAlt")}

{t("howWorks.heading")}

{steps.map((step, idx) => (

{t.rich(`howWorks.steps.${idx}.body1`, { code, em, strong })}

{step.items && (
    {step.items.map((_, iIdx) => (
  • {t.rich(`howWorks.steps.${idx}.items.${iIdx}`, { strong, code })}
  • ))}
)} {step.body2 && (

{t.rich(`howWorks.steps.${idx}.body2`, { code })}

)}
))}

{t("reversible.heading")}

{t("reversible.intro")}

{groups.map((group) => (

{group.title}

{group.items.map((item) => (
{item.tool}
{item.restores}
))}
))}

{t("edge.heading")}

{t.rich("edge.packageBody", { strong, code })} {t.rich("edge.rebootBody", { code, em })} {t.rich("edge.perItemBody", { em })}

{t("inspect.heading")}

{t("inspect.intro")}

{t.rich("inspect.outro", { code })}

{t.rich("inspect.reinstallBody", { link: postInstallLink })}

{t("related.heading")}

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