interface Props {
title: string;
count: number;
}
function Widget({ title, count }: Props): JSX.Element {
return (
{title}
{count > 0 && (
{Array.from({ length: count }).map((_, i) => (
- {i}
))}
)}
);
}
const data = service
.fetch()
.then((res) => res.json());