department-of-veterans-affairs/vets-website

View on GitHub
src/applications/_mock-form-ae-design-patterns/shared/components/Debug.jsx

Summary

Maintainability
A
0 mins
Test Coverage
import React from 'react';
import environment from 'platform/utilities/environment';

export const Debug = ({ data }) => {
  if (!environment.isLocalhost()) {
    return null;
  }
  try {
    return <pre>{JSON.stringify(data, null, 2)}</pre>;
  } catch (e) {
    return <pre>{e.message}</pre>;
  }
};