{"size": 426, "ext": "js", "max_stars_repo_path": "src/containers/board/readonly-note.js", "max_stars_repo_name": "buraksaraloglu/whatwas", "max_stars_repo_stars_event_min_datetime": "2021-01-14T09:15:14.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-20T11:10:55.000Z", "max_issues_repo_path": "src/containers/board/readonly-note.js", "max_issues_repo_name": "buraksaraloglu/whatwas", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/containers/board/readonly-note.js", "max_forks_repo_name": "buraksaraloglu/whatwas", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 4, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 30.4285714286, "max_line_length": 76, "alphanum_fraction": 0.6643192488}
import React, { useState, useEffect, useRef } from 'react';
import ReactQuill from 'react-quill';
import 'react-quill/dist/quill.bubble.css';

export const ReadOnlyNote = (props) => {
  const note =
    props.note.length > 0 && props.note[0] === '{'
      ? JSON.parse(props.note)
      : props.note;
  const [value, setValue] = useState(note);

  return <ReactQuill theme="bubble" defaultValue={value} readOnly={true} />;
};
