;;
module Layout = struct
let[@react.component] make ~children =
(React.string "Bloody Shovel 5")
children
;;
end
module PostPreviews = struct
let[@react.component] make ~(conn : Query.conn) =
let posts =
match Query.get_poasts () conn with
| Error _err -> []
| Ok posts -> posts
in
let tests = "This is 'a 'weird " in
(match posts with
| [] -> React.string "No posts"
| posts ->
let ps =
posts
|> List.map (fun (p : Query.post_summary) ->
Logs.info (fun d -> d "poast %s\n" p.title);
(React.string p.title)
)
in
let pp = React.string tests :: ps in
pp |> Array.of_list |> React.array)
;;
end
let[@react.component] make (conn : Query.conn) =
;;
(* let[@react.component] make (conn : Query.conn) = *)
(* let posts = *)
(* match Query.get_poasts () conn with *)
(* | Error _err -> [] *)
(* | Ok posts -> posts *)
(* in *)
(*
*)
(* (match posts with *)
(* | [] -> React.string "No posts" *)
(* | hd :: _tl -> React.string hd.title) *)
(*