refactor(react/collections): move layer name to view

This commit is contained in:
Elian Doran
2025-09-03 23:35:29 +03:00
parent 1969ce562a
commit 330b17bff8
2 changed files with 12 additions and 12 deletions

View File

@@ -1,15 +1,21 @@
import Map from "./map";
import "./index.css";
import { ViewModeProps } from "../interface";
import { useNoteLabel } from "../../react/hooks";
import { DEFAULT_MAP_LAYER_NAME } from "./map_layer";
const DEFAULT_COORDINATES: [number, number] = [3.878638227135724, 446.6630455551659];
const DEFAULT_ZOOM = 2;
export default function GeoView() {
export default function GeoView({ note }: ViewModeProps) {
const [ layerName ] = useNoteLabel(note, "map:style");
return (
<div className="geo-view">
<Map
coordinates={DEFAULT_COORDINATES}
zoom={DEFAULT_ZOOM}
layerName={layerName ?? DEFAULT_MAP_LAYER_NAME}
/>
</div>
);