import PropTypes from 'prop-types'; import FormSelect from 'calypso/components/forms/form-select'; import { useNotificationDevicesQuery } from 'calypso/data/notification-devices/use-notification-devices-query'; import { getLabelForStream } from './locales'; const options = [ 'timeline', 'email' ]; function NotificationSettingsFormStreamSelector( { selectedStream, onChange } ) { const { data: devices = [] } = useNotificationDevicesQuery(); options .map( ( stream ) => ( ) ) .concat( devices.map( ( device ) => ( ) ) ); return (
onChange( event.target.value ) }> { options }
); } NotificationSettingsFormStreamSelector.propTypes = { selectedStream: PropTypes.oneOfType( [ PropTypes.string, PropTypes.number ] ).isRequired, settings: PropTypes.object, onChange: PropTypes.func.isRequired, }; export default NotificationSettingsFormStreamSelector;