/opt/canhelp/apps/web/src/components
Edit: /opt/canhelp/apps/web/src/components/PlanBadge.tsx (3100B)
import type { PlanTier } from '@/lib/api'
interface PlanBadgeProps {
tier: PlanTier
verified?: boolean
size?: 'sm' | 'md'
className?: string
}
const tierConfig: Record
= {
free: {
label: 'Free',
class: 'bg-gray-100 text-gray-500 border border-gray-200',
icon: '',
},
pro: {
label: 'Pro',
class: 'bg-green-100 text-green-700 border border-green-200',
icon: (
) as unknown as string,
},
ultimate: {
label: 'Ultimate',
class: 'bg-gradient-to-r from-amber-400 via-yellow-400 to-amber-400 text-gray-900 border border-amber-500 shadow-sm shadow-amber-300/50',
icon: (
) as unknown as string,
},
}
export function PlanBadge({ tier, verified, size = 'sm', className = '' }: PlanBadgeProps) {
if (tier === 'free' && !verified) return null
const sizeClass = size === 'sm' ? 'text-[10px] px-1.5 py-0.5' : 'text-xs px-2 py-0.5'
if (verified && tier !== 'free') {
return (
{tier === 'ultimate' ? : }
{tierConfig[tier].label}
)
}
if (verified) {
return (
)
}
const cfg = tierConfig[tier]
return (
{tier === 'pro' && }
{tier === 'ultimate' && }
{cfg.label}
)
}
function StarIcon({ className = '' }: { className?: string }) {
return (
)
}
function VerifiedIcon({ className = '' }: { className?: string }) {
return (
)
}