index.tsx 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. import { useTranslation } from 'react-i18next'
  2. import CustomWebAppBrand from '../custom-web-app-brand'
  3. import s from '../style.module.css'
  4. import GridMask from '@/app/components/base/grid-mask'
  5. import UpgradeBtn from '@/app/components/billing/upgrade-btn'
  6. import { useProviderContext } from '@/context/provider-context'
  7. import { Plan } from '@/app/components/billing/type'
  8. import { contactSalesUrl } from '@/app/components/billing/config'
  9. const CustomPage = () => {
  10. const { t } = useTranslation()
  11. const { plan, enableBilling } = useProviderContext()
  12. const showBillingTip = enableBilling && plan.type === Plan.sandbox
  13. const showContact = enableBilling && (plan.type === Plan.professional || plan.type === Plan.team)
  14. return (
  15. <div className='flex flex-col'>
  16. {
  17. showBillingTip && (
  18. <GridMask canvasClassName='!rounded-xl'>
  19. <div className='flex justify-between mb-1 px-6 py-5 h-[88px] shadow-md rounded-xl border-[0.5px] border-gray-200'>
  20. <div className={`${s.textGradient} leading-[24px] text-base font-semibold`}>
  21. <div>{t('custom.upgradeTip.prefix')}</div>
  22. <div>{t('custom.upgradeTip.suffix')}</div>
  23. </div>
  24. <UpgradeBtn />
  25. </div>
  26. </GridMask>
  27. )
  28. }
  29. <CustomWebAppBrand />
  30. {
  31. showContact && (
  32. <div className='absolute bottom-0 h-[50px] leading-[50px] text-xs text-gray-500'>
  33. {t('custom.customize.prefix')}
  34. <a className='text-[#155EEF]' href={contactSalesUrl} target='_blank' rel='noopener noreferrer'>{t('custom.customize.contactUs')}</a>
  35. {t('custom.customize.suffix')}
  36. </div>
  37. )
  38. }
  39. </div>
  40. )
  41. }
  42. export default CustomPage