'use client';
import{jsxs as e,Fragment as r,jsx as t}from"react/jsx-runtime";import{composeAppendTypoClass as m,composeAppendTypoStyle as o}from"../common/helpers.js";import{createClass as s,createStyle as n,If as i}from"@gem-sdk/system";import{getBreadcrumbChildItemStyles as l,generateBreadcrumbChildIconStyles as a}from"../common/styles.js";import{getBreadcrumbChildItemClasses as c,getBreadcrumbSecondItemClasses as d,generateBreadcrumbClasses as p}from"../common/classes.js";import{useMemo as f}from"react";let BreadcrumbItem=y=>{let{breadcrumbItemIndex:h,lengthOfBreadcrumb:u,setting:j,templateName:x,styles:g}=y,{hideCurrentPage:I,labelColor:b,fontWeight:B,iconSvg:C}=j??{},N=s({...c(h,u,m(g?.typo))}),S=n({...l({breadcrumbItemIndex:h,lengthOfBreadcrumb:u,fontWeight:B,appendTypoStyle:o(g?.typo),labelColor:b})}),T=n({...a(j?.iconWidth,j?.color)}),$=s({...d(h+1,I,u)}),_=f(()=>h+1===u,[h,u]),k=s({...p(j?.hideCurrentPage,{indexOffset:h??0,lengthOfBreadcrumb:u,extendCondition:_})}),v=f(()=>_?`${N} ${k}`.trim():N,[N,k,_]);return e(r,{children:[t("div",{className:v,style:S,children:t("span",{children:x})}),i(!!(C&&!_),t("span",{style:T,className:$,dangerouslySetInnerHTML:{__html:C??""}}))]})};export{BreadcrumbItem as default};
