index.tsx 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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 } = useProviderContext()
  13. return (
  14. <div className='flex flex-col'>
  15. {
  16. plan.type === Plan.sandbox && (
  17. <GridMask canvasClassName='!rounded-xl'>
  18. <div className='flex justify-between mb-1 px-6 py-5 h-[88px] shadow-md rounded-xl border-[0.5px] border-gray-200'>
  19. <div className={`${s.textGradient} leading-[24px] text-base font-semibold`}>
  20. <div>{t('custom.upgradeTip.prefix')}</div>
  21. <div>{t('custom.upgradeTip.suffix')}</div>
  22. </div>
  23. <UpgradeBtn />
  24. </div>
  25. </GridMask>
  26. )
  27. }
  28. <CustomWebAppBrand />
  29. {
  30. plan.type === Plan.sandbox && (
  31. <>
  32. <div className='my-2 h-[0.5px] bg-gray-100'></div>
  33. <CustomAppHeaderBrand />
  34. </>
  35. )
  36. }
  37. {
  38. (plan.type === Plan.professional || plan.type === Plan.team) && (
  39. <div className='absolute bottom-0 h-[50px] leading-[50px] text-xs text-gray-500'>
  40. {t('custom.customize.prefix')}
  41. <a className='text-[#155EEF]' href={contactSalesUrl} target='_blank'>{t('custom.customize.contactUs')}</a>
  42. {t('custom.customize.suffix')}
  43. </div>
  44. )
  45. }
  46. </div>
  47. )
  48. }
  49. export default CustomPage