UNPKG

@expofp/floorplan

Version:

Interactive floor plan library for expos and events

2 lines (1 loc) 1.22 kB
import{jsx as o,Fragment as x,jsxs as l}from"react/jsx-runtime";import _ from"classnames";import r from"../../store";import u from"../../ui/Badge";const N={exhibitor:"icon-exhibitor-solid",event:"icon-event-solid",booth:"icon-booth-solid"},p=s=>/^\d+$/.test(s),y=({item:s,isLast:m})=>{const{type:n,entity:c,booth:t}=s,f=N[n]||"icon-booth-solid",h=c.name??"",i=(n==="exhibitor"||n==="event")&&t?t.name:null,e=t?.layer?.shortName??null,b=i||e,v=[h,i,e?p(e)?`Level ${e}`:e:null].filter(Boolean).join(", "),d=()=>{n==="exhibitor"?r.selectExhibitor(c):t&&r.selectBooth(t),r.showMap()};return l("div",{className:_("efp-planner__stop",{"is-last":m}),children:[o("div",{className:"efp-planner__stop-timeline",children:o("div",{className:"efp-planner__stop-icon",style:{"--dot-color":`var(--color-${n})`},children:o("i",{className:f})})}),l("div",{className:"efp-planner__stop-content",role:"button",tabIndex:0,"aria-label":v,onClick:d,onKeyDown:a=>{(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),d())},children:[o("strong",{children:h}),b&&l(u,{variant:"location",size:"xs",inline:!0,noMargins:!0,children:[i&&o("span",{children:i}),e&&l("span",{children:[p(e)&&o(x,{children:"Level\xA0"}),e]})]})]})]})};export default y;