UNPKG

@expofp/floorplan

Version:

Interactive floor plan library for expos and events

2 lines (1 loc) 615 B
import{jsx as l,jsxs as d}from"react/jsx-runtime";import"./HeatmapLegend.scss";import m from"classnames";const p=({ticks:e,ariaLabel:s,className:n,style:t})=>{if(e.length===0)return null;const a=e.map(r=>r.color),o=a.length===1?a[0]:`linear-gradient(to right, ${a.join(", ")})`;return d("div",{className:m("efp-heatmap-legend",n),style:t,role:"img","aria-label":s,children:[l("div",{className:"efp-heatmap-legend__colors",style:{background:o},"aria-hidden":"true"}),l("div",{className:"efp-heatmap-legend__values",children:e.map(({value:r},i)=>l("span",{"aria-hidden":"true",children:r},i))})]})};export default p;