import { StatusChip } from "../status/StatusChip.mjs";
import { DirectoryListItem } from "./DirectoryListItem.mjs";
import { c } from "react-compiler-runtime";
import React from "react";
import { makeStyles } from "@material-ui/core";
//#region src/UI/dataDisplay/directory/Directory.jsx
const useStyles = makeStyles((theme) => ({ root: {} }));
const Directory = (t0) => {
	const $ = c(9);
	const { data, success, warning, error, info, key, statusKey } = t0;
	const classes = useStyles();
	let t1;
	if ($[0] !== classes.root || $[1] !== data || $[2] !== error || $[3] !== info || $[4] !== key || $[5] !== statusKey || $[6] !== success || $[7] !== warning) {
		const dataTransform = data.reduce(_temp, {});
		const result = Object.values(dataTransform);
		t1 = /* @__PURE__ */ React.createElement("div", { className: classes.root }, result.map((item) => /* @__PURE__ */ React.createElement(DirectoryListItem, {
			key,
			letter: item.alphabet
		}, item.record.map((item_0) => /* @__PURE__ */ React.createElement("div", {
			style: { marginBottom: 8 },
			key: statusKey
		}, /* @__PURE__ */ React.createElement(StatusChip, {
			success,
			warning,
			error,
			info,
			label: item_0.name,
			status: item_0.status
		}))))));
		$[0] = classes.root;
		$[1] = data;
		$[2] = error;
		$[3] = info;
		$[4] = key;
		$[5] = statusKey;
		$[6] = success;
		$[7] = warning;
		$[8] = t1;
	} else t1 = $[8];
	return t1;
};
function _temp(r, e) {
	const alphabet = e.name[0];
	if (!r[alphabet]) r[alphabet] = {
		alphabet,
		record: [e]
	};
	else r[alphabet].record.push(e);
	return r;
}
//#endregion
export { Directory };

//# sourceMappingURL=Directory.mjs.map