From 77950e48c76f4a3b29d01831d43039caba29888a Mon Sep 17 00:00:00 2001
From: wwf <1971391498@qq.com>
Date: 星期二, 18 十一月 2025 14:12:42 +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