Unnamed repository; edit this file 'description' to name the repository.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
interface Props {
  title: string;
  count: number;
}

function Widget({ title, count }: Props): JSX.Element {
  return (
    <div className="widget">
      <span>{title}</span>
      {count > 0 && (
        <ul>
          {Array.from({ length: count }).map((_, i) => (
            <li key={i}>{i}</li>
          ))}
        </ul>
      )}
    </div>
  );
}

const data = service
  .fetch()
  .then((res) => res.json());