huridocs/uwazi

View on GitHub
app/react/App/ShowIf.tsx

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
import React from 'react';

type ShowIfProps = {
  if: boolean;
  children: React.ReactElement;
};

// eslint-disable-next-line react/jsx-no-useless-fragment
const ShowIf = ({ if: condition, children }: ShowIfProps) => (!condition ? <></> : children);

export default ShowIf;