From 69312f5133734237edaea6ca29e2de9bf3203050 Mon Sep 17 00:00:00 2001 From: polwex Date: Sun, 15 Jun 2025 01:44:45 +0700 Subject: checkpoint here... --- bs5/universal/native/shared/Debug_props.re | 89 ++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 bs5/universal/native/shared/Debug_props.re (limited to 'bs5/universal/native/shared/Debug_props.re') diff --git a/bs5/universal/native/shared/Debug_props.re b/bs5/universal/native/shared/Debug_props.re new file mode 100644 index 0000000..49b4567 --- /dev/null +++ b/bs5/universal/native/shared/Debug_props.re @@ -0,0 +1,89 @@ +[@warning "-33"]; + +open Melange_json.Primitives; + +[@react.client.component] +let make = + ( + ~string: string, + ~int: int=999999, + ~float: float, + ~bool_true: bool, + ~bool_false: bool, + ~string_list: list(string), + ~header: option(React.element), + ~children: React.element, + ~promise: Js.Promise.t(string), + ) => { + + + {React.array([| + + {React.array([| + {React.string("string")} , + {React.string(string)} + |])} + , + + {React.array([| + {React.string("int")} , + {React.int(int)} + |])} + , + + {React.array([| + {React.string("float")} , + {React.float(float)} + |])} + , + + {React.array([| + {React.string("bool_true")} , + {React.string(bool_true ? "true" : "false")} + |])} + , + + {React.array([| + {React.string("bool_false")} , + {React.string(bool_false ? "true" : "false")} + |])} + , + + {React.array([| + {React.string("string_list")} , + + {string_list + |> Array.of_list + |> Array.map(item => {React.string(item)} ) + |> React.array} + + |])} + , + + {React.array([| + {React.string("React.element")} , + children + |])} + , + + {React.array([| + + {React.string("option(React.element)")} + , + {switch (header) { + | Some(header) =>
header
+ | None => React.null + }} + |])} +
, + + {React.array([| + {React.string("Promise")} , + + |])} + + |])} +
+
; +}; -- cgit v1.2.3