feat(billing): add tax information tooltips in pricing footer (#26705)

Co-authored-by: CodingOnStar <hanxujiang@dify.ai>
This commit is contained in:
Coding On Star
2025-10-10 15:34:56 +08:00
committed by GitHub
parent cf1778e696
commit 3a5aa4587c
5 changed files with 25 additions and 4 deletions

View File

@ -2,19 +2,29 @@ import React from 'react'
import Link from 'next/link'
import { useTranslation } from 'react-i18next'
import { RiArrowRightUpLine } from '@remixicon/react'
import { type Category, CategoryEnum } from '.'
import cn from '@/utils/classnames'
type FooterProps = {
pricingPageURL: string
currentCategory: Category
}
const Footer = ({
pricingPageURL,
currentCategory,
}: FooterProps) => {
const { t } = useTranslation()
return (
<div className='flex min-h-16 w-full justify-center border-t border-divider-accent px-10'>
<div className='flex max-w-[1680px] grow justify-end border-x border-divider-accent p-6'>
<div className={cn('flex max-w-[1680px] grow border-x border-divider-accent p-6', currentCategory === CategoryEnum.CLOUD ? 'justify-between' : 'justify-end') }>
{currentCategory === CategoryEnum.CLOUD && (
<div className='flex flex-col text-text-tertiary'>
<span className='system-xs-regular'>{t('billing.plansCommon.taxTip')}</span>
<span className='system-xs-regular'>{t('billing.plansCommon.taxTipSecond')}</span>
</div>
)}
<span className='flex h-fit items-center gap-x-1 text-saas-dify-blue-accessible'>
<Link
href={pricingPageURL}

View File

@ -13,7 +13,12 @@ import { useAppContext } from '@/context/app-context'
import { useGetPricingPageLanguage } from '@/context/i18n'
import { NoiseBottom, NoiseTop } from './assets'
export type Category = 'cloud' | 'self'
export enum CategoryEnum {
CLOUD = 'cloud',
SELF = 'self',
}
export type Category = CategoryEnum.CLOUD | CategoryEnum.SELF
type PricingProps = {
onCancel: () => void
@ -25,7 +30,7 @@ const Pricing: FC<PricingProps> = ({
const { plan } = useProviderContext()
const { isCurrentWorkspaceManager } = useAppContext()
const [planRange, setPlanRange] = React.useState<PlanRange>(PlanRange.monthly)
const [currentCategory, setCurrentCategory] = useState<Category>('cloud')
const [currentCategory, setCurrentCategory] = useState<Category>(CategoryEnum.CLOUD)
const canPay = isCurrentWorkspaceManager
useKeyPress(['esc'], onCancel)
@ -57,7 +62,7 @@ const Pricing: FC<PricingProps> = ({
planRange={planRange}
canPay={canPay}
/>
<Footer pricingPageURL={pricingPageURL} />
<Footer pricingPageURL={pricingPageURL} currentCategory={currentCategory}/>
<div className='absolute -bottom-12 left-0 right-0 -z-10'>
<NoiseBottom />
</div>