Suspendedremoval

This commit is contained in:
2026-05-01 18:17:04 +02:00
parent de1bb9bd02
commit a2cdc095ef
2 changed files with 9 additions and 4 deletions

View File

@@ -4,6 +4,7 @@ import { useState } from "react";
import { useRouter } from "next/navigation"; import { useRouter } from "next/navigation";
import { useTranslations, useFormatter } from "next-intl"; import { useTranslations, useFormatter } from "next-intl";
import { Modal } from "@/components/ui/modal"; import { Modal } from "@/components/ui/modal";
import { formatRelative } from "@/lib/format";
interface Props { interface Props {
tenantName: string; tenantName: string;
@@ -198,7 +199,6 @@ export function SubscriptionToggle({
// Owner with pending resume request: render the request status // Owner with pending resume request: render the request status
// card with cancel. // card with cancel.
if (pendingResumeRequest) { if (pendingResumeRequest) {
const submittedDate = new Date(pendingResumeRequest.createdAt);
return ( return (
<div> <div>
<div className="rounded-xl border border-amber-500/30 bg-amber-500/5 px-4 py-3"> <div className="rounded-xl border border-amber-500/30 bg-amber-500/5 px-4 py-3">
@@ -206,8 +206,8 @@ export function SubscriptionToggle({
{t("resumeRequestPendingTitle")} {t("resumeRequestPendingTitle")}
</div> </div>
<div className="text-xs text-text-secondary"> <div className="text-xs text-text-secondary">
{t.rich("resumeRequestPendingDescription", { {t("resumeRequestPendingDescription", {
when: f.relativeTime(submittedDate), when: formatRelative(pendingResumeRequest.createdAt, f),
})} })}
</div> </div>
<button <button

View File

@@ -233,8 +233,13 @@ export interface TenantRequest {
* reactivation of a suspended tenant). Default 'provision' for all * reactivation of a suspended tenant). Default 'provision' for all
* pre-existing rows; resume rows have most provision fields null * pre-existing rows; resume rows have most provision fields null
* but tenant_name set to the tenant being requested. * but tenant_name set to the tenant being requested.
*
* Optional on the TS type so provision-only callers (like the
* onboarding wizard's create flow) don't need to know about resume
* requests. The DB column is NOT NULL DEFAULT 'provision', so rows
* loaded via `mapRow` always have a value populated.
*/ */
requestType: "provision" | "resume"; requestType?: "provision" | "resume";
createdAt: string; createdAt: string;
updatedAt: string; updatedAt: string;
} }