Every list screen needs at least: loading, empty (success but no rows), and error. Pick a userId that has posts (1–10) or invent a filter that yields none client-side.

State: idle

Load to cycle loading → data or empty or error.

Important JavaScript

setState("loading");
try {
  const rows = await loadRows();
  if (rows.length === 0) {
    setState("empty");
  } else {
    setState("data");
    render(rows);
  }
} catch (error) {
  setState("error");
  showError(error.message);
}