Debian Codegraph @

tests/indent/tsx.tsx

raw
1 interface Props {
2 title: string;
3 count: number;
4 }
5
6 function Widget({ title, count }: Props): JSX.Element {
7 return (
8 <div className="widget">
9 <span>{title}</span>
10 {count > 0 && (
11 <ul>
12 {Array.from({ length: count }).map((_, i) => (
13 <li key={i}>{i}</li>
14 ))}
15 </ul>
16 )}
17 </div>
18 );
19 }
20
21 const data = service
22 .fetch()
23 .then((res) => res.json());