체험 계정도 업그레이드 승인되도록 수정

This commit is contained in:
2026-09-06 12:16:17 +09:00
parent 7303aa98b8
commit 309b70ece4
5 changed files with 486 additions and 179 deletions
@@ -5,7 +5,7 @@ import { useRouter } from "next/navigation";
import { ArrowUp } from "lucide-react";
import { Button } from "@/components/ui/button";
import { ACCOUNT_TYPES, ACTIVATE_STATUSES } from "@/lib/constants";
import { ACCOUNT_TYPES, ACTIVATE_STATUSES, PAID_ACCOUNT_TYPE_VALUES } from "@/lib/constants";
import { formatDateTime, getAccountTypeLabel, getRequestStatusLabel } from "@/lib/utils";
import type { MaestroDetail } from "@/lib/maestros";
@@ -42,9 +42,14 @@ export function UpgradeRequestsSection({
const [errorMessage, setErrorMessage] = useState("");
const isTrial = activateStatus === ACTIVATE_STATUSES.TRIAL;
const isCurrentPaid = (PAID_ACCOUNT_TYPE_VALUES as readonly number[]).includes(accountType);
const isUpgradeEnabled =
selectedAccountType !== null &&
(isTrial ? selectedAccountType >= accountType : selectedAccountType > accountType);
(!isCurrentPaid
? true
: isTrial
? selectedAccountType >= accountType
: selectedAccountType > accountType);
const isDisabled = isCreating || isPending;
async function handleUpgrade() {
@@ -111,7 +116,13 @@ export function UpgradeRequestsSection({
<option value=""> </option>
{upgradeOptions.map((opt) => (
<option
disabled={isTrial ? opt.value < accountType : opt.value <= accountType}
disabled={
isCurrentPaid
? isTrial
? opt.value < accountType
: opt.value <= accountType
: false
}
key={opt.value}
value={opt.value}
>