index.tsx 2.0 KB

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