From a430284aa21e3ae1f0d5654e55b2ad2852519cc2 Mon Sep 17 00:00:00 2001 From: wwf <yearningwang@iqtogether.com> Date: 星期三, 04 六月 2025 15:17:49 +0800 Subject: [PATCH] 初始化 --- app/components/billing/header-billing-btn/index.tsx | 24 +++++------------------- 1 files changed, 5 insertions(+), 19 deletions(-) diff --git a/app/components/billing/header-billing-btn/index.tsx b/app/components/billing/header-billing-btn/index.tsx index f34fa0b..a841552 100644 --- a/app/components/billing/header-billing-btn/index.tsx +++ b/app/components/billing/header-billing-btn/index.tsx @@ -7,13 +7,11 @@ import { useProviderContext } from '@/context/provider-context' type Props = { - onClick?: () => void - isDisplayOnly?: boolean + onClick: () => void } const HeaderBillingBtn: FC<Props> = ({ onClick, - isDisplayOnly = false, }) => { const { plan, enableBilling, isFetchedPlan } = useProviderContext() const { @@ -27,9 +25,9 @@ })() const classNames = (() => { if (type === Plan.professional) - return `border-[#E0F2FE] ${!isDisplayOnly ? 'hover:border-[#B9E6FE]' : ''} bg-[#E0F2FE] text-[#026AA2]` + return 'border-[#E0F2FE] hover:border-[#B9E6FE] bg-[#E0F2FE] text-[#026AA2]' if (type === Plan.team) - return `border-[#E0EAFF] ${!isDisplayOnly ? 'hover:border-[#C7D7FE]' : ''} bg-[#E0EAFF] text-[#3538CD]` + return 'border-[#E0EAFF] hover:border-[#C7D7FE] bg-[#E0EAFF] text-[#3538CD]' return '' })() @@ -37,22 +35,10 @@ return null if (type === Plan.sandbox) - return <UpgradeBtn onClick={isDisplayOnly ? undefined : onClick} isShort /> - - const handleClick = () => { - if (!isDisplayOnly && onClick) - onClick() - } + return <UpgradeBtn onClick={onClick} isShort /> return ( - <div - onClick={handleClick} - className={cn( - classNames, - 'flex h-[22px] items-center rounded-md border px-2 text-xs font-semibold uppercase', - isDisplayOnly ? 'cursor-default' : 'cursor-pointer', - )} - > + <div onClick={onClick} className={cn(classNames, 'flex items-center h-[22px] px-2 rounded-md border text-xs font-semibold uppercase cursor-pointer')}> {name} </div> ) -- Gitblit v1.8.0