'use client' import AppContext from '@/context/app-context' import { LicenseStatus } from '@/types/feature' import { useTranslation } from 'react-i18next' import { useContextSelector } from 'use-context-selector' import dayjs from 'dayjs' const LicenseNav = () => { const { t } = useTranslation() const systemFeatures = useContextSelector(AppContext, s => s.systemFeatures) if (systemFeatures.license?.status === LicenseStatus.EXPIRING) { const expiredAt = systemFeatures.license?.expired_at const count = dayjs(expiredAt).diff(dayjs(), 'days') return
{count <= 1 && {t('common.license.expiring', { count })}} {count > 1 && {t('common.license.expiring_plural', { count })}}
} if (systemFeatures.license.status === LicenseStatus.ACTIVE) { return
Enterprise
} return null } export default LicenseNav