Fix website (#12745)

This commit is contained in:
fisker Cheung authored and GitHub committed 2022-04-29 15:09:54 +08:00
1 parent c6d6b25833
commit 23f5ca2476
1 file changed
+17 -2
+17 -2
View File
@@ -1,9 +1,24 @@
import * as React from "react";
import { groupBy } from "../../../src/cli/utils.js";
import { SidebarCategory } from "./components.js";
import Option from "./options.js";
// Copied from `/src/cli/utils.js`
function groupBy(array, iteratee) {
const result = Object.create(null);
for (const value of array) {
const key = iteratee(value);
if (Array.isArray(result[key])) {
result[key].push(value);
} else {
result[key] = [value];
}
}
return result;
}
export default function SidebarOptions({
categories,
availableOptions,