"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("../../_virtual/jsx-runtime.js"),x=require("react"),R=require("./styles.js"),I=require("./utils.js"),L=require("./components/ListItemPrefix/index.js"),f=require("./components/ListItemContent/index.js"),q=require("./components/ListItemSuffix/index.js"),E=require("../../utils/index.js");const h=n=>{const{variant:e="default",state:a="default",primaryText:u,prefix:r,suffix:i,divider:o=!1,dividerStartsFromText:l=!1,disabled:d,onClick:m}=n,j=I.getListItemWrapperByVariant(e),s=x.createRef(),[v,p]=x.useState(0);return x.useEffect(()=>{var c;(c=s.current)!=null&&c.clientWidth&&p(s.current.clientWidth)},[s.current,r]),t.jsxRuntimeExports.jsx(j,{divider:o,onClick:a==="default"&&!d?m:E.noop,state:a,prefixWidth:v,dividerStartsFromText:l,disabled:d,children:t.jsxRuntimeExports.jsxs(R.ListItemFlexContainer,{variant:e,children:[r&&t.jsxRuntimeExports.jsx(L.ListItemPrefix,{prefix:r,variant:e,ref:s}),n.variant==="multi-line"?t.jsxRuntimeExports.jsx(f.ListItemContent,{primaryText:u,secondaryText:n.secondaryText,variant:e,prefix:r,suffix:i}):t.jsxRuntimeExports.jsx(f.ListItemContent,{primaryText:u,variant:e,prefix:r,suffix:i}),i&&t.jsxRuntimeExports.jsx(q.ListItemSuffix,{suffix:i,variant:e})]})})};exports.ListItem=h;
