parent
c2900763c7
commit
9a8dacc38a
@ -1,13 +1,45 @@
|
|||||||
|
import { useMode } from "../stores/useMode";
|
||||||
|
import { MODES } from "../config";
|
||||||
|
import { APPROVE_COLOR, WORKING_COLOR } from "./Layers/layers-config";
|
||||||
import { Title } from "../components/Title";
|
import { Title } from "../components/Title";
|
||||||
|
|
||||||
|
const LegendPointItem = ({ color, name }) => {
|
||||||
|
return (
|
||||||
|
<div className="flex gap-2 items-center">
|
||||||
|
<span
|
||||||
|
className="rounded-xl w-3 h-3 inline-block"
|
||||||
|
style={{ backgroundColor: color }}
|
||||||
|
/>
|
||||||
|
<span>{name}</span>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
export function Legend() {
|
export function Legend() {
|
||||||
|
const { mode } = useMode();
|
||||||
|
|
||||||
|
const getContent = () => {
|
||||||
|
if (mode === MODES.APPROVE_WORKING) {
|
||||||
return (
|
return (
|
||||||
<div className="absolute bottom-[10px] left-[10px] text-xs text-grey z-10">
|
<>
|
||||||
<Title
|
<Title text={"Статус локации"} className={"text-center"} />
|
||||||
text={"Размер кружка пропорционален прогнозному трафику"}
|
<div className="space-y-2">
|
||||||
className={"text-center mb-1"}
|
<LegendPointItem
|
||||||
classNameText={"lowercase"}
|
name="Согласование-установка"
|
||||||
|
color={APPROVE_COLOR}
|
||||||
/>
|
/>
|
||||||
|
<LegendPointItem name="Работает" color={WORKING_COLOR} />
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="absolute bottom-[20px] left-[20px] text-xs text-grey z-10 bg-white-background-light rounded-xl p-3">
|
||||||
|
{getContent()}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in new issue