diff --git a/frontend/src/components/Licensed.jsx b/frontend/src/components/Licensed.jsx new file mode 100644 index 00000000..afc96cea --- /dev/null +++ b/frontend/src/components/Licensed.jsx @@ -0,0 +1,357 @@ + + +import { + CheckCircle, + Warning as AlertCircle, + Shield as ShieldIcon, + Warning as WarningIcon, + ChevronRight as ChevronRightIcon +} from '@mui/icons-material'; +import { useContext, useState } from "react"; +import { Context } from "../context/ContextApi.jsx"; +import { useNavigate } from 'react-router-dom'; + +const Licensed = ({licensed, expanded, showBadge}) => { + + const { themeMode } = useContext(Context); + const navigate = useNavigate() + + + const [isHovered, setIsHovered] = useState(false); + + const theme = { + light: { + cardBg: '#ffffff', + cardBgHover: '#f5f7fa', + border: '#e1e4e8', + textPrimary: '#1f2937', + textSecondary: '#6b7280', + textMuted: '#9ca3af', + success: '#10b981', + successBg: licensed ? 'rgba(5, 150, 105, 0.08)' : '#ddf4ff', + successBorder: 'rgba(5, 150, 105, 0.2)', + warning: '#d97706', + warningBg: licensed ? '#fef3c7' : 'rgba(245, 158, 11, 0.08)', + warningBorder: 'rgba(245, 158, 11, 0.2)', + shadow: 'rgba(0, 0, 0, 0.05)', + }, + dark: { + cardBg: '#1a1a1a', + cardBgHover: '#242424', + border: '#30363d', + textPrimary: '#e6edf3', + textSecondary: '#8b949e', + textMuted: '#6e7681', + success: '#10b981', + successBg: 'rgba(16, 185, 129, 0.1)', + successBorder: 'rgba(16, 185, 129, 0.3)', + warning: '#f59e0b', + warningBg: 'rgba(245, 158, 11, 0.1)', + warningBorder: 'rgba(245, 158, 11, 0.3)', + shadow: 'rgba(0, 0, 0, 0.3)', + }, + }; + + const colors = themeMode === "dark" ? theme.dark : theme.light; + + const statusConfig = licensed + ? { + icon: showBadge ? ShieldIcon : CheckCircle, + text: showBadge ? 'Licensed' : 'Enterprise Licensed', + shortText: 'Licensed', + subtitle: 'Full access', + color: colors.success, + bgColor: colors.successBg, + borderColor: colors.successBorder, + description: 'All features unlocked', + } + : { + icon: showBadge ? WarningIcon : AlertCircle, + text: showBadge ? 'Unlicensed' : 'Activate License', + shortText: 'Inactive', + subtitle: 'Limited access', + color: colors.warning, + bgColor: colors.warningBg, + borderColor: colors.warningBorder, + description: 'Limited access', + }; + + const Icon = statusConfig.icon; + + // Display badge when showing license status only + // Display full component for CTA to license activation + if (showBadge) { + return ( +