index.tsx 805 B

1234567891011121314151617181920212223242526
  1. import React from 'react';
  2. import styles from './styles.module.css';
  3. export default function CustomFieldProperty(props: { required: boolean; type: string; typeLink?: string }) {
  4. return (
  5. <div className={styles.wrapper}>
  6. <div>
  7. {props.required ? (
  8. <span className="badge badge--primary">Required</span>
  9. ) : (
  10. <span className="badge badge--secondary">Optional</span>
  11. )}
  12. </div>
  13. <div>
  14. {props.typeLink ? (
  15. <a href={props.typeLink}>
  16. <code>{props.type}</code>
  17. </a>
  18. ) : (
  19. <code>{props.type}</code>
  20. )}
  21. </div>
  22. </div>
  23. );
  24. }