체험 계정도 업그레이드 승인되도록 수정
This commit is contained in:
@@ -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}
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user