Problem statement
A reusable function that fills a metrics dashboard from a list of metrics using Vanilla TypeScript and standard DOM APIs. The page provides an empty container — the function builds every tile and puts them in place, rather than assembling the dashboard out of HTML text.
Demo
The page, styles, dashboard container, and metric data are already scaffolded and wired. Only the renderDashboardTiles function is missing — implement it in src/dashboardGrid.ts so every test passes. Do not edit any other file.
What to implement
- Take a container and a list of metrics, and fill that container with them.
- Produce one tile per metric, keeping the order the metrics arrived in.
- Give every tile its own element for the label, its own for the value, and its own for the unit.
- Show each value word for word, exactly as the metric supplies it.
- Attach each metric's key to its tile, so a tile can be traced back to the metric it came from.
- Mark every tile with how the metric is trending, so a rising, falling, and unchanged metric each read differently at a glance. A tile shows one trend and never more.
- Single out the tiles that have not reached their target, and leave the ones that have met or passed it alone.
- Show a stand-in message instead of the dashboard when there are no metrics to show, with no tiles alongside it.
- Fill the container you were given, rather than building a new one to take its place.
- Everything the dashboard shows must come from the metrics you were given. Nothing should be fixed in advance.
