import {
  section_title_default
} from "./chunk-XPULPCGT.js";
import {
  curriculum_sidebar_item_wrapper_default
} from "./chunk-LRKARLHL.js";
import {
  section_item_default
} from "./chunk-ILQIHURK.js";
import {
  getCurriculumIconColor
} from "./chunk-PAFFDZBG.js";
import {
  __spreadProps,
  __spreadValues
} from "./chunk-2NMEKWO5.js";

// src/molecules/curriculumV2/CurriculumSidebar/sidebar-item.tsx
import { jsx } from "react/jsx-runtime";
function SidebarItem({ item, selectedIndex, setSelectedIndex, index, done }) {
  if (item.type === "sectionTitle") {
    return /* @__PURE__ */ jsx(section_title_default, __spreadValues({}, item), item.uuid);
  }
  const isSelected = selectedIndex === index;
  return /* @__PURE__ */ jsx(
    curriculum_sidebar_item_wrapper_default,
    {
      index,
      isSelected,
      onClick: () => {
        setSelectedIndex(index);
      },
      children: /* @__PURE__ */ jsx(
        section_item_default,
        __spreadProps(__spreadValues({}, item), {
          color: getCurriculumIconColor({
            done,
            selected: isSelected
          })
        })
      )
    },
    item.uuid
  );
}
var sidebar_item_default = SidebarItem;

export {
  sidebar_item_default
};
//# sourceMappingURL=chunk-AT5SWXDV.js.map