@expofp/floorplan
Version:
Interactive floor plan library for expos and events
2 lines (1 loc) • 2.57 kB
JavaScript
import{jsx as o,jsxs as i,Fragment as x}from"react/jsx-runtime";import"./SetKioskComponent.scss";import{useState as L}from"react";import r from"../../../tools/base-runtime-url";import N from"../../../ui/Draggable";import{t as e}from"../../../utils/i18n";import{ConfirmDialog as y}from"./Confirm/ConfirmDialog";import{InfoMessage as K}from"./Message/InfoMessage";import{SetKioskForm as j}from"./SetKioskForm";import I from"./SetKioskStatusMessages";export default function U({isSaveDisabled:c,isDeleteDisabled:m,areControlsDisabled:d,confirmOnClose:g,angle:p,uiScale:f,minUiScale:h,maxUiScale:k,uiScaleStep:u,iconSizePercent:v,isInfoVisible:b,statusMessages:S,onClose:D,onDelete:C,onSave:_,onChange:s}){const[t,n]=L(null);return o("div",{className:"efp-set-kiosk-mode-anchor",children:i(N,{className:"efp-set-kiosk-mode",children:[i("div",{className:"efp-set-kiosk-mode__header",children:[o("img",{src:`${r}icons/dragdrop-solid.svg`,alt:e("Drag and Drop Icon"),width:"24",height:"24"}),o("span",{className:"efp-no-select",children:t?t.title:e("Set Kiosk")}),o("button",{type:"button",draggable:"false",className:"efp-set-kiosk-mode__close","aria-label":e("Close"),onClick:()=>{const a=()=>{n(null)},l=()=>{D?.(),n(null)};t?a():g?n({title:e("Leave without saving?"),content:i("span",{children:[e("You have changes that "),o("strong",{children:e("haven't been saved.")})]}),confirmLabel:e("Keep editing"),cancelLabel:e("Leave"),onCancel:l,onConfirm:a,confirmVariant:"primary",cancelVariant:"danger"}):l()},children:o("i",{className:"icon-close"})})]}),!t&&o(I,{messages:S}),b?o(K,{list:[{id:"1",image:{src:`${r}icons/tap.svg`,alt:e("Tap to set or move kiosk.")},content:i("span",{children:[e("Tap to "),o("strong",{children:e("set or move")}),e(" kiosk.")]})},{id:"2",image:{src:`${r}icons/rotate.svg`,alt:e("Zoom and rotate the map before saving.")},content:i("span",{children:[o("strong",{children:e("Zoom and rotate")}),e(" the map before saving.")]})}]}):o(x,{children:t?o(y,{...t}):o(j,{isSaveDisabled:c,isDeleteDisabled:m,areControlsDisabled:d,onSave:()=>{_?.(),n(null)},onDelete:()=>{n({title:e("Delete kiosk?"),content:i("span",{children:[e("Are you sure you want to "),o("strong",{children:e("delete this kiosk?")})]}),confirmLabel:e("Cancel"),cancelLabel:e("Delete"),onConfirm:()=>{n(null)},onCancel:()=>{C?.(),n(null)},confirmVariant:"gray",cancelVariant:"danger"})},angle:p,onRotateIcon:a=>s?.({angle:a}),uiScale:f,minUiScale:h,maxUiScale:k,uiScaleStep:u,onUiScaleChange:a=>s?.({scale:a}),iconSizePercent:v,onChangeIconSizePercent:a=>s?.({percent:a})})})]})})}