all repos — h3 @ 68daa6a4f7e8660bb651e52e6d2a171984f568ad

A tiny, extremely minimalist JavaScript microframework.

docs/example/assets/js/components/EmptyTodoError.js

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

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