import React, {PropTypes} from 'react'; import {Cookie} from 'tough-cookie'; const ResponseCookiesViewer = ({headers, showCookiesModal}) => { if (!headers.length) { // Don't do anything if no cookies return No cookies returned; } return (
{headers.map((h, i) => { const cookie = Cookie.parse(h.value); return ( ); })}
Name Value
{cookie.key} {cookie.value}

) }; ResponseCookiesViewer.propTypes = { showCookiesModal: PropTypes.func.isRequired, headers: PropTypes.array.isRequired }; export default ResponseCookiesViewer;