import React from 'react'; import PropTypes from 'prop-types'; import { useSelector } from 'react-redux'; import { InfoOutline } from '@openedx/paragon/icons'; import { useIntl } from '@edx/frontend-platform/i18n'; import { Icon, OverlayTrigger, Tooltip } from '@openedx/paragon'; import messages from './messages'; import { useIsOnMobile } from '../hooks'; import { notificationChannels } from './data/utils'; import { selectAppPreferences } from './data/selectors'; import NotificationPreferenceColumn from './NotificationPreferenceColumn'; const NotificationTypes = ({ appId }) => { const intl = useIntl(); const preferences = useSelector(selectAppPreferences(appId)); const mobileView = useIsOnMobile(); const NOTIFICATION_CHANNELS = notificationChannels(); return (
{preferences.map(preference => ( (preference?.coreNotificationTypes?.length > 0 || preference.id !== 'core') && ( <>
{intl.formatMessage(messages.notificationTitle, { text: preference.id })} {preference.info !== '' && ( {preference.info} )} > )}
{mobileView && (
{Object.values(NOTIFICATION_CHANNELS).map((channel) => ( ))}
)} ) ))}
); }; NotificationTypes.propTypes = { appId: PropTypes.string.isRequired, }; export default React.memo(NotificationTypes);