;
{
  try {
    let e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
    n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "e4df7561-1c66-4243-80e0-c5f1d50384fc", e._sentryDebugIdIdentifier = "sentry-dbid-e4df7561-1c66-4243-80e0-c5f1d50384fc");
  } catch (e) {
  }
}
;
import { jsxs, jsx, Fragment } from "preact/jsx-runtime";
import cx from "classnames";
import { A as Avatar } from "./Avatar-9UrQk3Hf.js";
import { r as Icon } from "./StoreProvider-CqQrndhS.js";
const listItem = "adyen-kyc-list-item";
const listItemInteractive = "adyen-kyc-list-item-interactive";
const listItemText = "adyen-kyc-list-item-text";
const listItemTitle = "adyen-kyc-list-item-title";
const listItemDescription = "adyen-kyc-list-item-description";
const listItemDisclosure = "adyen-kyc-list-item-disclosure";
const listItemAccessory = "adyen-kyc-list-item-accessory";
const styles = {
  listItem,
  listItemInteractive,
  listItemText,
  listItemTitle,
  listItemDescription,
  listItemDisclosure,
  listItemAccessory
};
const ListItem = ({ accessory, action, avatar, description, title }) => {
  const isInteractive = !!action && typeof action.onClick === "function";
  const isDisabled = !!action?.disabled;
  const listItemAvatar = {
    ...avatar,
    ...isDisabled && { variant: "disabled" }
  };
  const rootClassname = cx(styles.listItem, {
    [styles.listItemInteractive]: isInteractive
  });
  const content = /* @__PURE__ */ jsxs(Fragment, { children: [
    avatar && /* @__PURE__ */ jsx(Avatar, { ...listItemAvatar }),
    /* @__PURE__ */ jsxs("div", { className: styles.listItemText, children: [
      /* @__PURE__ */ jsx("h3", { className: styles.listItemTitle, children: title }),
      description && /* @__PURE__ */ jsx("span", { className: styles.listItemDescription, children: description })
    ] }),
    accessory && /* @__PURE__ */ jsx("div", { className: styles.listItemAccessory, children: accessory })
  ] });
  if (isInteractive) {
    return /* @__PURE__ */ jsxs(
      "button",
      {
        "aria-label": title,
        className: rootClassname,
        disabled: isDisabled,
        onClick: action.onClick,
        type: "button",
        children: [
          content,
          action?.disclosure && !isDisabled && /* @__PURE__ */ jsx("div", { className: styles.listItemDisclosure, "data-testid": "disclosure-indicator", children: /* @__PURE__ */ jsx(Icon, { name: "chevron-right" }) })
        ]
      }
    );
  } else {
    return /* @__PURE__ */ jsx("div", { className: rootClassname, children: content });
  }
};
export {
  ListItem as L
};
