Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function JsDocsLayout$Docs(Props) {
var match = Props.components;
var components = match !== undefined ? Caml_option.valFromOption(match) : SidebarLayout.ApiMd.components;
var children = Props.children;
var router = Router.useRouter();
var route = router.route;
var headers = Belt_Option.getWithDefault(Belt_Option.map(Js_dict.get(indexData, route), (function (data) {
return data.headers;
})), /* array */[]);
var moduleName = Belt_Option.getWithDefault(Belt_Option.map(Js_dict.get(indexData, route), (function (data) {
return data.moduleName;
})), "?");
var match$1 = React.useState((function () {
return false;
}));
var setSidebarOpen = match$1[1];
var toggleSidebar = function (param) {
return Curry._1(setSidebarOpen, (function (prev) {
return !prev;
function ActiveLink(Props) {
var href = Props.href;
var activeClassName = Props.activeClassName;
var match = Props.router;
var router = match !== undefined ? Caml_option.valFromOption(match) : Caml_option.nullable_to_opt(Router.useRouter());
var children = Props.children;
var handleClick = function ($$event) {
$$event.preventDefault();
Belt_Option.map(router, (function (router) {
return router.push(href);
}));
return /* () */0;
};
var className = Cn.make(/* :: */[
Cn.ifTrue(activeClassName, Belt_Option.getWithDefault(Belt_Option.map(router, (function (router) {
return router.pathname;
})), "/") === href),
/* [] */0
]);
return React.createElement("a", {
className: className,
var useQuery = function (query, displayName, skip, variables, fetchPolicy, errorPolicy, pollInterval, client, notifyOnNetworkStatusChange, context, partialRefetch, returnPartialData, ssr, onCompleted, onError, param) {
var tmp = { };
if (displayName !== undefined) {
tmp.displayName = Caml_option.valFromOption(displayName);
}
if (skip !== undefined) {
tmp.skip = Caml_option.valFromOption(skip);
}
var tmp$1 = Belt_Option.map(variables, QueryConfig[/* parse */0]);
if (tmp$1 !== undefined) {
tmp.variables = Caml_option.valFromOption(tmp$1);
}
if (fetchPolicy !== undefined) {
tmp.fetchPolicy = Caml_option.valFromOption(fetchPolicy);
}
if (errorPolicy !== undefined) {
tmp.errorPolicy = Caml_option.valFromOption(errorPolicy);
}
if (pollInterval !== undefined) {
tmp.pollInterval = Caml_option.valFromOption(pollInterval);
}
if (client !== undefined) {
tmp.client = Caml_option.valFromOption(client);
}
if (notifyOnNetworkStatusChange !== undefined) {
tmp.notifyOnNetworkStatusChange = Caml_option.valFromOption(notifyOnNetworkStatusChange);
}
if (context !== undefined) {
tmp.context = Caml_option.valFromOption(context);
}
}
if (skip !== undefined) {
tmp.skip = Caml_option.valFromOption(skip);
}
var tmp$1 = Belt_Option.map(variables, QueryConfig[/* parse */0]);
if (tmp$1 !== undefined) {
tmp.variables = Caml_option.valFromOption(tmp$1);
}
if (fetchPolicy !== undefined) {
tmp.fetchPolicy = Caml_option.valFromOption(fetchPolicy);
}
if (errorPolicy !== undefined) {
tmp.errorPolicy = Caml_option.valFromOption(errorPolicy);
}
if (pollInterval !== undefined) {
tmp.pollInterval = Caml_option.valFromOption(pollInterval);
}
if (client !== undefined) {
tmp.client = Caml_option.valFromOption(client);
}
if (notifyOnNetworkStatusChange !== undefined) {
tmp.notifyOnNetworkStatusChange = Caml_option.valFromOption(notifyOnNetworkStatusChange);
}
if (context !== undefined) {
tmp.context = Caml_option.valFromOption(context);
}
if (partialRefetch !== undefined) {
tmp.partialRefetch = Caml_option.valFromOption(partialRefetch);
}
if (returnPartialData !== undefined) {
tmp.returnPartialData = Caml_option.valFromOption(returnPartialData);
}
}
if (context !== undefined) {
tmp.context = Caml_option.valFromOption(context);
}
if (partialRefetch !== undefined) {
tmp.partialRefetch = Caml_option.valFromOption(partialRefetch);
}
if (returnPartialData !== undefined) {
tmp.returnPartialData = Caml_option.valFromOption(returnPartialData);
}
if (ssr !== undefined) {
tmp.ssr = Caml_option.valFromOption(ssr);
}
var tmp$2 = Belt_Option.map(onCompleted, mapOnCompleted);
if (tmp$2 !== undefined) {
tmp.onCompleted = Caml_option.valFromOption(tmp$2);
}
if (onError !== undefined) {
tmp.onError = Caml_option.valFromOption(onError);
}
var opt = tmp;
var response = ReactHooks.useQuery(query, opt);
return /* record */[
/* data */Belt_Option.map(Belt_Option.flatMap(Caml_option.undefined_to_opt(response.data), mapEmptyObject), Config[/* parse */0]),
/* loading */response.loading,
/* error */Caml_option.undefined_to_opt(response.error),
/* variables */Curry._1(QueryConfig[/* parse */0], response.variables),
/* networkStatus */response.networkStatus
];
};
return /* module */[
}
if (skip !== undefined) {
tmp.skip = Caml_option.valFromOption(skip);
}
var tmp$1 = Belt_Option.map(variables, QueryConfig[/* parse */0]);
if (tmp$1 !== undefined) {
tmp.variables = Caml_option.valFromOption(tmp$1);
}
if (fetchPolicy !== undefined) {
tmp.fetchPolicy = Caml_option.valFromOption(fetchPolicy);
}
if (errorPolicy !== undefined) {
tmp.errorPolicy = Caml_option.valFromOption(errorPolicy);
}
if (pollInterval !== undefined) {
tmp.pollInterval = Caml_option.valFromOption(pollInterval);
}
if (client !== undefined) {
tmp.client = Caml_option.valFromOption(client);
}
if (notifyOnNetworkStatusChange !== undefined) {
tmp.notifyOnNetworkStatusChange = Caml_option.valFromOption(notifyOnNetworkStatusChange);
}
if (context !== undefined) {
tmp.context = Caml_option.valFromOption(context);
}
if (partialRefetch !== undefined) {
tmp.partialRefetch = Caml_option.valFromOption(partialRefetch);
}
if (returnPartialData !== undefined) {
tmp.returnPartialData = Caml_option.valFromOption(returnPartialData);
}
var useQuery = function (overrideQuery, displayName, skip, variables, fetchPolicy, errorPolicy, pollInterval, client, notifyOnNetworkStatusChange, context, partialRefetch, returnPartialData, ssr, onCompleted, onError, param) {
var tmp = { };
if (displayName !== undefined) {
tmp.displayName = Caml_option.valFromOption(displayName);
}
if (skip !== undefined) {
tmp.skip = Caml_option.valFromOption(skip);
}
var tmp$1 = Belt_Option.map(variables, QueryConfig[/* parse */0]);
if (tmp$1 !== undefined) {
tmp.variables = Caml_option.valFromOption(tmp$1);
}
if (fetchPolicy !== undefined) {
tmp.fetchPolicy = Caml_option.valFromOption(fetchPolicy);
}
if (errorPolicy !== undefined) {
tmp.errorPolicy = Caml_option.valFromOption(errorPolicy);
}
if (pollInterval !== undefined) {
tmp.pollInterval = Caml_option.valFromOption(pollInterval);
}
if (client !== undefined) {
tmp.client = Caml_option.valFromOption(client);
}
if (notifyOnNetworkStatusChange !== undefined) {
tmp.notifyOnNetworkStatusChange = Caml_option.valFromOption(notifyOnNetworkStatusChange);
}
if (context !== undefined) {
tmp.context = Caml_option.valFromOption(context);
}
tmp.pollInterval = Caml_option.valFromOption(pollInterval);
}
if (client !== undefined) {
tmp.client = Caml_option.valFromOption(client);
}
if (notifyOnNetworkStatusChange !== undefined) {
tmp.notifyOnNetworkStatusChange = Caml_option.valFromOption(notifyOnNetworkStatusChange);
}
if (context !== undefined) {
tmp.context = Caml_option.valFromOption(context);
}
if (partialRefetch !== undefined) {
tmp.partialRefetch = Caml_option.valFromOption(partialRefetch);
}
if (returnPartialData !== undefined) {
tmp.returnPartialData = Caml_option.valFromOption(returnPartialData);
}
if (ssr !== undefined) {
tmp.ssr = Caml_option.valFromOption(ssr);
}
var tmp$2 = Belt_Option.map(onCompleted, mapOnCompleted);
if (tmp$2 !== undefined) {
tmp.onCompleted = Caml_option.valFromOption(tmp$2);
}
if (onError !== undefined) {
tmp.onError = Caml_option.valFromOption(onError);
}
var opt = tmp;
var response = ReactHooks.useQuery(query, opt);
return /* record */[
/* data */Belt_Option.map(Belt_Option.flatMap(Caml_option.undefined_to_opt(response.data), mapEmptyObject), Config[/* parse */0]),
/* loading */response.loading,
tmp.variables = Caml_option.valFromOption(tmp$1);
}
if (fetchPolicy !== undefined) {
tmp.fetchPolicy = Caml_option.valFromOption(fetchPolicy);
}
if (errorPolicy !== undefined) {
tmp.errorPolicy = Caml_option.valFromOption(errorPolicy);
}
if (pollInterval !== undefined) {
tmp.pollInterval = Caml_option.valFromOption(pollInterval);
}
if (client !== undefined) {
tmp.client = Caml_option.valFromOption(client);
}
if (notifyOnNetworkStatusChange !== undefined) {
tmp.notifyOnNetworkStatusChange = Caml_option.valFromOption(notifyOnNetworkStatusChange);
}
if (context !== undefined) {
tmp.context = Caml_option.valFromOption(context);
}
if (partialRefetch !== undefined) {
tmp.partialRefetch = Caml_option.valFromOption(partialRefetch);
}
if (returnPartialData !== undefined) {
tmp.returnPartialData = Caml_option.valFromOption(returnPartialData);
}
if (ssr !== undefined) {
tmp.ssr = Caml_option.valFromOption(ssr);
}
var tmp$2 = Belt_Option.map(onCompleted, mapOnCompleted);
if (tmp$2 !== undefined) {
tmp.onCompleted = Caml_option.valFromOption(tmp$2);
tmp.errorPolicy = Caml_option.valFromOption(errorPolicy);
}
if (pollInterval !== undefined) {
tmp.pollInterval = Caml_option.valFromOption(pollInterval);
}
if (client !== undefined) {
tmp.client = Caml_option.valFromOption(client);
}
if (notifyOnNetworkStatusChange !== undefined) {
tmp.notifyOnNetworkStatusChange = Caml_option.valFromOption(notifyOnNetworkStatusChange);
}
if (context !== undefined) {
tmp.context = Caml_option.valFromOption(context);
}
if (partialRefetch !== undefined) {
tmp.partialRefetch = Caml_option.valFromOption(partialRefetch);
}
if (returnPartialData !== undefined) {
tmp.returnPartialData = Caml_option.valFromOption(returnPartialData);
}
if (ssr !== undefined) {
tmp.ssr = Caml_option.valFromOption(ssr);
}
var tmp$2 = Belt_Option.map(onCompleted, mapOnCompleted);
if (tmp$2 !== undefined) {
tmp.onCompleted = Caml_option.valFromOption(tmp$2);
}
if (onError !== undefined) {
tmp.onError = Caml_option.valFromOption(onError);
}
var opt = tmp;
var response = ReactHooks.useQuery(query, opt);