text: import React from "react";
  import styled from "styled-components";
  
  const StyledDiv = styled.div`
    margin-bottom: 20px;
    @media (min-width: 40.0625em) {
      margin-bottom: 30px;
    }
    :last-of-type {
      margin-bottom: 0;
    }
    padding: 0;
    border: 0;
    margin-bottom: 5px;
    margin-top: 0px;
  `;
  
  const StyledFieldset = styled.fieldset`
    margin: 0;
    padding: 0;
    border: 0;
    :after {
      content: "";
      display: block;
      clear: both;
    }
    margin-top: 0px;
  `;
  
  const StyledLegend = styled.legend`
    font-family: Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.25;
    color: #0b0c0c;
    box-sizing: border-box;
    display: table;
    max-width: 100%;
    margin-bottom: 0px;
    padding: 0;
    overflow: hidden;
    white-space: normal;
    @media print {
      font-family: sans-serif;
    }
    @media (min-width: 40.0625em) {
      font-size: 1.1875rem;
      line-height: 1.31579;
    }
    @media print {
      font-size: 14pt;
      line-height: 1.15;
    }
    @media print {
      color: #000000;
    }
    margin-top: 0px;
  `;
  
  const StyledDiv2 = styled.div`
    font-family: Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.25;
    display: block;
    margin-bottom: 15px;
    color: #595959;
    @media print {
      font-family: sans-serif;
    }
    @media (min-width: 40.0625em) {
      font-size: 1.1875rem;
      line-height: 1.31579;
    }
    @media print {
      font-size: 14pt;
      line-height: 1.15;
    }
    margin-top: -5px;
    margin-top: 0px;
  `;
  
  const StyledDiv3 = styled.div`
    margin-top: 0px;
  `;
  
  const FieldsetBlock = ({ hintId, legend, hint, children }) => (
    <StyledDiv>
      <StyledFieldset aria-describedby={hintId}>
        <StyledLegend>
          {legend !== undefined ? (
            legend
          ) : (
            <React.Fragment>Legend text</React.Fragment>
          )}
        </StyledLegend>
        {hintId !== undefined ? (
          <React.Fragment>
            <StyledDiv2 id={hintId}>
              {hint !== undefined ? (
                hint
              ) : (
                <React.Fragment>Hint text</React.Fragment>
              )}
            </StyledDiv2>
          </React.Fragment>
        ) : (
          ""
        )}
        <StyledDiv3>
          {children !== undefined ? (
            children
          ) : (
            <React.Fragment>Fieldset contents</React.Fragment>
          )}
        </StyledDiv3>
      </StyledFieldset>
    </StyledDiv>
  );
  
  export default FieldsetBlock;
  