@expofp/floorplan
Version:
Interactive floor plan library for expos and events
2 lines (1 loc) • 1.17 kB
JavaScript
import{jsx as r,jsxs as s}from"react/jsx-runtime";import"./RoutePlanner.scss";import{useObserver as a}from"mobx-react-lite";import i,{uiState as n}from"../../store";import{Route as u}from"../../store/RouteStore";import{t as m}from"../../utils/i18n";import p from"../WayfindingFloorSelectorContainer";import f from"./RoutePlannerHeader";import c from"./RoutePlannerStartPoint";import d from"./RoutePlannerStopItem";function P(){return a(()=>{const t=i.routePlannerStore,o=t.items;return s("div",{className:"efp-planner",children:[o.length>0&&r(f,{}),o.length>0&&t.routeFloors.length>1&&t.currentRouteFloor&&r(p,{floors:t.routeFloors,value:t.currentRouteFloor,onSelect:e=>t.setRouteFloor(e)}),s("div",{className:"efp-planner__stops",children:[o.length>0&&r(c,{startPoint:t.startPoint,onSelectStartPoint:e=>t.setStartPoint(e)}),o.map((e,l)=>r(d,{item:e,isLast:l===o.length-1},`${e.type}-${e.entity.id}-${l}`))]}),o.length===0&&r("div",{className:"efp-planner__empty",children:m("Add stops to build a route")})]})})}function h(){return a(()=>{const t=n.details&&!(n.details instanceof u);return n.list.type==="route-planner"&&!n.menu&&!t?r(P,{}):null})}export default h;