wwf
3 天以前 a430284aa21e3ae1f0d5654e55b2ad2852519cc2
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>
  )