import React from 'react';
import PropTypes from 'prop-types';
import { getConfig } from '@edx/frontend-platform';
import { FormattedMessage, useIntl } from '@edx/frontend-platform/i18n';
import { Alert, Button, Hyperlink } from '@openedx/paragon';
import certImage from '../../../generic/assets/edX_certificate.png';
import messages from './messages';
/**
* Note for Open edX developers:
* There are pieces of this component that are hard-coded and specific to edX that may not apply to your organization.
* This includes mentions of our edX program types (MicroMasters, MicroBachelors, Professional Certificate, and
* XSeries), along with their respective support article URLs and image variable names.
*
* Currently, this component will not render unless the learner's completed course has a related program of one of the
* four aforementioned types. This will not impact the parent components (i.e. CourseCelebration will render normally).
*/
const programTypes = ['microbachelors', 'micromasters', 'professional-certificate', 'xseries'];
const ProgramCompletion = ({
progress,
title,
type,
url,
}) => {
const intl = useIntl();
if (!programTypes.includes(type) || progress.notStarted !== 0 || progress.inProgress !== 0) {
return null;
}
const programLink = (
{intl.formatMessage(messages.dashboardLink)}
);
return (
{intl.formatMessage(messages.programsLastCourseHeader, { title })}