list.tsx 402 B

12345678910111213141516171819202122
  1. import styled from '@emotion/styled';
  2. type Props = {
  3. items: Array<React.ReactElement>;
  4. className?: string;
  5. };
  6. function List({items, className}: Props) {
  7. if (!items.length) {
  8. return null;
  9. }
  10. return <Wrapper className={className}>{items}</Wrapper>;
  11. }
  12. export default List;
  13. const Wrapper = styled('div')`
  14. display: flex;
  15. flex-wrap: wrap;
  16. font-size: ${p => p.theme.fontSizeSmall};
  17. `;