import { Maybe } from '@/core';
import { licenseStatus } from '@/shared/localEnum/constants/licenseStatus';

export function getLicenseStatus(licenseExpiresAt?: Maybe<string>) {
  if (!licenseExpiresAt) {
    return null;
  }
  if (new Date().getTime() > new Date(licenseExpiresAt || '').getTime()) {
    return licenseStatus.EXPIRED;
  }
  return licenseStatus.ACTIVE;
}
