# All files / components/Note Note.js

75% Statements 3/4
100% Branches 0/0
0% Functions 0/1
75% Lines 3/4

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34

    4x

    4x

    4x

     import React from 'react';
    import PropTypes from 'prop-types';
    import NoteContainer from './styles/NoteContainer';
    import NoteCorner from './styles/NoteCorner';

    const Note = ({ children, Container, Corner }) => (
      <Container>
        {children}
        <Corner />
      </Container>
    );

    Note.propTypes = {
      /**
       * Contents of the note
       */
      children: PropTypes.node.isRequired,
      /**
       * Override the component that renders the outer container
       */
      Container: PropTypes.func,
      /**
       * Override the component that renders the corner
       */
      Corner: PropTypes.func,
    };

    Note.defaultProps = {
      Container: NoteContainer,
      Corner: NoteCorner,
    };

    export default Note;