Remove the per-route 'export const instant = false' opt-outs now that the root layout carries the single Cache Components opt-out. Child pages inherit the opt-out, so admin/mod/radio leaf pages that only access cached or DB data stay instant while runtime-dependent pages remain dynamic. Update the staff-smoke contract test to assert the root-layout contract.
52 lines
1.4 KiB
TypeScript
52 lines
1.4 KiB
TypeScript
import Link from "next/link";
|
|
import { getTranslations } from "next-intl/server";
|
|
import { resetPassword } from "@/actions/password-reset";
|
|
import { ContentCard } from "@/components/public/ui";
|
|
|
|
export default async function ResetPage({
|
|
searchParams,
|
|
}: {
|
|
searchParams: Promise<{ email?: string; token?: string; error?: string }>;
|
|
}) {
|
|
const t = await getTranslations("pages.reset");
|
|
const { email = "", token = "", error } = await searchParams;
|
|
|
|
return (
|
|
<main style={{ maxWidth: 420, margin: "2rem auto" }}>
|
|
<ContentCard icon="🔐" title={t("title")} subtitle={t("subtitle")}>
|
|
<form action={resetPassword} style={{ display: "grid", gap: "0.7rem" }}>
|
|
<input type="hidden" name="email" value={email} />
|
|
<input type="hidden" name="token" value={token} />
|
|
<input
|
|
name="password"
|
|
type="password"
|
|
placeholder={t("passwordPlaceholder")}
|
|
autoComplete="new-password"
|
|
required
|
|
/>
|
|
<button type="submit" className="btn btn-primary">
|
|
{t("resetPassword")}
|
|
</button>
|
|
</form>
|
|
{error ? (
|
|
<p
|
|
style={{
|
|
color: "var(--color-danger)",
|
|
textAlign: "center",
|
|
marginBottom: 0,
|
|
}}
|
|
>
|
|
{error}
|
|
</p>
|
|
) : null}
|
|
<p
|
|
className="muted"
|
|
style={{ textAlign: "center", marginBottom: 0, marginTop: "1rem" }}
|
|
>
|
|
<Link href="/login">{t("backToLogin")}</Link>
|
|
</p>
|
|
</ContentCard>
|
|
</main>
|
|
);
|
|
}
|