import { h } from 'preact'; import PropTypes from 'prop-types'; import { RequestListItem } from './RequestListItem'; export const ChannelRequestSection = ({ channelRequests, handleRequestApproval, handleRequestRejection, }) => { if (channelRequests.length < 0) { return null; } return (
{channelRequests && channelRequests.map((channelPendingRequest) => { return ( ); })}
); }; ChannelRequestSection.propTypes = { channelRequests: PropTypes.arrayOf( PropTypes.shape({ name: PropTypes.string.isRequired, membership_id: PropTypes.number.isRequired, user_id: PropTypes.number.isRequired, role: PropTypes.string.isRequired, image: PropTypes.string.isRequired, username: PropTypes.string.isRequired, status: PropTypes.string.isRequired, channel_name: PropTypes.string.isRequired, }), ).isRequired, handleRequestApproval: PropTypes.func.isRequired, handleRequestRejection: PropTypes.func.isRequired, };