EditWaypoint.res
1@jsx.component
2let make = (
3 ~docID: string,
4 ~waypoints: array<Waypoint.attributes>,
5 ~attrs: Waypoint.attributes,
6) => {
7 let _ydoc = State.docs->Map.get(docID)
8 let editor = State.Editor.get(docID)
9 Console.log2("waypoints", waypoints)
10 <div className="flex flex-col">
11 <Content.CloseButton
12 onClose={() => {
13 let _ = Window.setTimeout(() => {
14 // little delay, then blur editor so the clicked waypoint isn't selected
15 let _ = editor->Option.map(ed => ed->Tiptap.Commands.blur)
16 }, 100)
17 }}
18 />
19 <h2> {attrs.label->Preact.string} </h2>
20 <div className="w-full h-20 bg-blue-100 text-center flex flex-col items-center justify-center">
21 <div> {`Yearly weather averages for ${attrs.label}. Coming soon!`->Preact.string} </div>
22 <div></div>
23 </div>
24 </div>
25}