diff options
author | 2021-09-27 21:21:51 -0700 | |
---|---|---|
committer | 2021-09-27 21:21:51 -0700 | |
commit | 2bb7f71b9c88b680008564cdf56186360228c317 (patch) | |
tree | 2c876e18189c7291c142f5c093f60b151a5d9528 /examples/macros/components | |
parent | 2f8be4f13f6be8577afbb4c65db2faadf9459751 (diff) | |
download | bun-2bb7f71b9c88b680008564cdf56186360228c317.tar.gz bun-2bb7f71b9c88b680008564cdf56186360228c317.tar.zst bun-2bb7f71b9c88b680008564cdf56186360228c317.zip |
Fix up examplesbun-v0.0.26
Diffstat (limited to 'examples/macros/components')
-rw-r--r-- | examples/macros/components/covid19.tsx | 33 | ||||
-rw-r--r-- | examples/macros/components/index.tsx | 1 |
2 files changed, 34 insertions, 0 deletions
diff --git a/examples/macros/components/covid19.tsx b/examples/macros/components/covid19.tsx new file mode 100644 index 000000000..52fee2ff3 --- /dev/null +++ b/examples/macros/components/covid19.tsx @@ -0,0 +1,33 @@ +import { fetchCSV } from "macro:fetchCSV"; + +export const Covid19 = () => { + const rows = fetchCSV( + "https://covid19.who.int/WHO-COVID-19-global-data.csv", + { + last: 100, + columns: ["New_cases", "Date_reported", "Country"], + } + ); + + return ( + <div> + <h2>Covid-19</h2> + <h6>last {rows.length} updates from the WHO</h6> + <div className="Table"> + <div className="Header"> + <div className="Heading">New Cases</div> + <div className="Heading">Date</div> + <div className="Heading">Country</div> + </div> + + {rows.map((row, index) => ( + <div className="Row" key={index}> + <div className="Column">{row[0]}</div> + <div className="Column">{row[1]}</div> + <div className="Column">{row[2]}</div> + </div> + ))} + </div> + </div> + ); +}; diff --git a/examples/macros/components/index.tsx b/examples/macros/components/index.tsx index 6c3e39be7..20e58b7b7 100644 --- a/examples/macros/components/index.tsx +++ b/examples/macros/components/index.tsx @@ -5,6 +5,7 @@ import { IPAddresses } from "./example"; const Start = function () { const root = document.createElement("div"); document.body.appendChild(root); + ReactDOM.render(<IPAddresses />, root); }; |