all repos — h3 @ 4eaeb4a491990f91fb316c0349ad12066b7666d8

A tiny, extremely minimalist JavaScript microframework.

example/assets/js/components/emptyTodoError.js

 1
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
import h3 from "../h3.js";

export default function EmptyTodoError(data, actions) {
  const { clearError } = actions;
  const { displayEmptyTodoError } = data;
  const emptyTodoErrorClass = displayEmptyTodoError ? "" : ".hidden";
  return h3(`div.error${emptyTodoErrorClass}`, [
    h3("span.error-message", ["Please enter a non-empty todo item."]),
    h3(
      "span.dismiss-error",
      {
        onclick: clearError,
      },
      "✘"
    ),
  ]);
}