Feat:edu frontend (#17251)
Co-authored-by: crazywoola <427733928@qq.com> Co-authored-by: zxhlyh <jasonapring2015@outlook.com>
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
import { useProviderContext } from '@/context/provider-context'
|
||||
import type { FC } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import {
|
||||
RiGraduationCapFill,
|
||||
} from '@remixicon/react'
|
||||
import { SparklesSoft } from '../../base/icons/src/public/common'
|
||||
import PremiumBadge from '../../base/premium-badge'
|
||||
import { Plan } from '../../billing/type'
|
||||
@@ -13,7 +16,7 @@ type PlanBadgeProps = {
|
||||
}
|
||||
|
||||
const PlanBadge: FC<PlanBadgeProps> = ({ plan, allowHover, sandboxAsUpgrade = false, onClick }) => {
|
||||
const { isFetchedPlan } = useProviderContext()
|
||||
const { isFetchedPlan, isEducationWorkspace } = useProviderContext()
|
||||
const { t } = useTranslation()
|
||||
|
||||
if (!isFetchedPlan) return null
|
||||
@@ -39,7 +42,8 @@ const PlanBadge: FC<PlanBadgeProps> = ({ plan, allowHover, sandboxAsUpgrade = fa
|
||||
if (plan === Plan.professional) {
|
||||
return <PremiumBadge className='select-none' size='s' color='blue' allowHover={allowHover} onClick={onClick}>
|
||||
<div className='system-2xs-medium-uppercase'>
|
||||
<span className='p-1'>
|
||||
<span className='p-1 inline-flex items-center gap-1'>
|
||||
{isEducationWorkspace && <RiGraduationCapFill className='w-3 h-3' />}
|
||||
pro
|
||||
</span>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user