objective categorical abstract machine language personal data server
1[@@@ocaml.warning "-26-27"]
2
3open React
4
5let[@react.component] make ~pages ~active_page ?header ?footer () =
6 let selected_class = "text-mana-100 font-medium" in
7 let unselected_class = "text-mist-100 hover:text-mana-100" in
8 <aside className="flex flex-col gap-y-2 w-auto min-w-32 max-w-64">
9 (match header with Some h -> h | None -> null)
10 <nav className="flex flex-col gap-y-1 mt-2">
11 ( List.map
12 (fun (label, href) ->
13 let className =
14 if href = active_page then selected_class else unselected_class
15 in
16 <a href className key=href>(string label)</a> )
17 pages
18 |> Array.of_list |> array )
19 </nav>
20 (match footer with Some f -> f | None -> null)
21 </aside>