import * as React from 'react';
import { useTreeEnvironment } from '../controlledEnvironment/ControlledTreeEnvironment';
import { LiveDescription } from './LiveDescription';

export const MaybeLiveDescription: React.FC = () => {
  const { showLiveDescription } = useTreeEnvironment();

  if (!(showLiveDescription ?? true)) {
    return null;
  }

  return <LiveDescription />;
};
