Files
NapCatQQ/.pnpm-store/v3/files/40/8c303a9bd2a7b7970738a881b6937f20ab399be102aaef4158cbaa37e96404e158d0469bc1dc593f7d5d7714903809e5077cd91f97cc0dafea494825884d3e
T
TanTan e311ca3275
Build NapCat Artifacts / Type Check & Test (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

56 lines
1.7 KiB
Plaintext

"use client";
import {
ListboxSelectedIcon
} from "./chunk-65JTUBIW.mjs";
import {
useListboxItem
} from "./chunk-IXUWKP6S.mjs";
// src/listbox-item.tsx
import { useMemo } from "react";
import { jsx, jsxs } from "react/jsx-runtime";
var ListboxItem = (props) => {
const {
Component,
rendered,
description,
isSelectable,
isSelected,
isDisabled,
selectedIcon,
startContent,
endContent,
hideSelectedIcon,
disableAnimation,
getItemProps,
getLabelProps,
getWrapperProps,
getDescriptionProps,
getSelectedIconProps
} = useListboxItem(props);
const selectedContent = useMemo(() => {
const defaultIcon = /* @__PURE__ */ jsx(ListboxSelectedIcon, { disableAnimation, isSelected });
if (typeof selectedIcon === "function") {
return selectedIcon({ icon: defaultIcon, isSelected, isDisabled });
}
if (selectedIcon)
return selectedIcon;
return defaultIcon;
}, [selectedIcon, isSelected, isDisabled, disableAnimation]);
return /* @__PURE__ */ jsxs(Component, { ...getItemProps(), children: [
startContent,
description ? /* @__PURE__ */ jsxs("div", { ...getWrapperProps(), children: [
/* @__PURE__ */ jsx("span", { ...getLabelProps(), children: rendered }),
/* @__PURE__ */ jsx("span", { ...getDescriptionProps(), children: description })
] }) : /* @__PURE__ */ jsx("span", { ...getLabelProps(), children: rendered }),
isSelectable && !hideSelectedIcon && /* @__PURE__ */ jsx("span", { ...getSelectedIconProps(), children: selectedContent }),
endContent
] });
};
ListboxItem.displayName = "HeroUI.ListboxItem";
var listbox_item_default = ListboxItem;
export {
listbox_item_default
};