/*!
 * Copyright (c) what3words http://what3words.com
 */
import { Fragment, h } from "@stencil/core";
const c = "what3words-autosuggest";
export const ErrorMessage = (props) => {
    if (!props.error)
        return h(Fragment, null);
    const width = props.offsetWidth
        ? String(props.offsetWidth) + "px"
        : undefined;
    return (h("div", { class: `${c}-error-wrapper`, style: { width }, "data-testid": "error-wrapper" }, h("div", { class: `${c}-error`, "data-testid": "error" }, h("div", { class: `${c}-message` }, props.error.message))));
};
