| 
									
										
										
										
											2023-12-18 16:25:37 +08:00
										 |  |  | import { useTranslation } from 'react-i18next' | 
					
						
							|  |  |  | import CustomWebAppBrand from '../custom-web-app-brand' | 
					
						
							|  |  |  | import { useProviderContext } from '@/context/provider-context' | 
					
						
							|  |  |  | import { Plan } from '@/app/components/billing/type' | 
					
						
							|  |  |  | import { contactSalesUrl } from '@/app/components/billing/config' | 
					
						
							| 
									
										
										
										
											2025-03-07 11:56:20 +08:00
										 |  |  | import { useModalContext } from '@/context/modal-context' | 
					
						
							| 
									
										
										
										
											2023-12-18 16:25:37 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | const CustomPage = () => { | 
					
						
							|  |  |  |   const { t } = useTranslation() | 
					
						
							| 
									
										
										
										
											2023-12-20 15:37:57 +08:00
										 |  |  |   const { plan, enableBilling } = useProviderContext() | 
					
						
							| 
									
										
										
										
											2025-03-07 11:56:20 +08:00
										 |  |  |   const { setShowPricingModal } = useModalContext() | 
					
						
							| 
									
										
										
										
											2023-12-20 15:37:57 +08:00
										 |  |  |   const showBillingTip = enableBilling && plan.type === Plan.sandbox | 
					
						
							|  |  |  |   const showContact = enableBilling && (plan.type === Plan.professional || plan.type === Plan.team) | 
					
						
							| 
									
										
										
										
											2023-12-18 16:25:37 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |   return ( | 
					
						
							|  |  |  |     <div className='flex flex-col'> | 
					
						
							| 
									
										
										
										
											2025-03-07 11:56:20 +08:00
										 |  |  |       {showBillingTip && ( | 
					
						
							| 
									
										
										
										
											2025-03-21 17:41:03 +08:00
										 |  |  |         <div className='mb-1 flex justify-between rounded-xl bg-gradient-to-r from-components-input-border-active-prompt-1 to-components-input-border-active-prompt-2 p-4 pl-6 shadow-lg backdrop-blur-sm'> | 
					
						
							| 
									
										
										
										
											2025-03-07 11:56:20 +08:00
										 |  |  |           <div className='space-y-1 text-text-primary-on-surface'> | 
					
						
							|  |  |  |             <div className='title-xl-semi-bold'>{t('custom.upgradeTip.title')}</div> | 
					
						
							|  |  |  |             <div className='system-sm-regular'>{t('custom.upgradeTip.des')}</div> | 
					
						
							| 
									
										
										
										
											2023-12-18 16:25:37 +08:00
										 |  |  |           </div> | 
					
						
							| 
									
										
										
										
											2025-03-21 17:41:03 +08:00
										 |  |  |           <div className='system-md-semibold flex h-10 w-[120px] cursor-pointer items-center justify-center rounded-3xl bg-white text-text-accent shadow-xs hover:opacity-95' onClick={() => setShowPricingModal()}>{t('billing.upgradeBtn.encourageShort')}</div> | 
					
						
							| 
									
										
										
										
											2025-03-07 11:56:20 +08:00
										 |  |  |         </div> | 
					
						
							|  |  |  |       )} | 
					
						
							|  |  |  |       <CustomWebAppBrand /> | 
					
						
							|  |  |  |       {showContact && ( | 
					
						
							| 
									
										
										
										
											2025-03-21 17:41:03 +08:00
										 |  |  |         <div className='absolute bottom-0 h-[50px] text-xs leading-[50px] text-text-quaternary'> | 
					
						
							| 
									
										
										
										
											2025-03-07 11:56:20 +08:00
										 |  |  |           {t('custom.customize.prefix')} | 
					
						
							|  |  |  |           <a className='text-text-accent' href={contactSalesUrl} target='_blank' rel='noopener noreferrer'>{t('custom.customize.contactUs')}</a> | 
					
						
							|  |  |  |           {t('custom.customize.suffix')} | 
					
						
							|  |  |  |         </div> | 
					
						
							|  |  |  |       )} | 
					
						
							| 
									
										
										
										
											2023-12-18 16:25:37 +08:00
										 |  |  |     </div> | 
					
						
							|  |  |  |   ) | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | export default CustomPage |