{"size": 805, "ext": "js", "max_stars_repo_path": "src/components/Good.js", "max_stars_repo_name": "selfup/avorion", "max_stars_repo_stars_event_min_datetime": "2020-05-09T02:11:27.000Z", "max_stars_repo_stars_event_max_datetime": "2020-05-09T02:11:27.000Z", "max_issues_repo_path": "src/components/Good.js", "max_issues_repo_name": "selfup/avorion", "max_issues_repo_issues_event_min_datetime": "2021-10-05T08:00:40.000Z", "max_issues_repo_issues_event_max_datetime": "2021-10-05T22:35:01.000Z", "max_forks_repo_path": "src/components/Good.js", "max_forks_repo_name": "selfup/avorion", "max_forks_repo_forks_event_min_datetime": "2021-02-24T15:28:50.000Z", "max_forks_repo_forks_event_max_datetime": "2021-02-24T15:28:50.000Z"}
{"max_stars_count": 1, "max_issues_count": 1, "max_forks_count": 1, "avg_line_length": 25.9677419355, "max_line_length": 72, "alphanum_fraction": 0.549068323}
import { h } from 'hyperapp';
import Traders from './Traders';

export default result => {
  const legal = result['Illegal?'] === 'no' ? 'LEGAL' : 'ILLEGAL';

  const dangerous =
    result['Dangerous?'] === 'no' ? 'SAFE' : 'NOT SAFE - DANGEROUS';

  const soldBy = result['Sold By'] ? result['Sold By'] : 'No One';

  const boughtBy = result['Bought By'] ? result['Bought By'] : 'No One';

  return (
    <article class="card">
      <h1>{result.Name}</h1>
      <p>Volume: {result.Volume}</p>
      <p>Avg Price: {result['Avg. Price']}</p>

      <h4>Sold By</h4>
      {Traders(soldBy)}

      <h4>Bought By</h4>
      {Traders(boughtBy)}

      <h5 class={legal === 'LEGAL' ? 'bad' : 'good'}>{legal}</h5>
      <h5 class={dangerous === 'SAFE' ? 'bad' : 'good'}>{dangerous}</h5>
    </article>
  );
};
