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

51 lines
1.3 KiB
Plaintext

"use client";
import {
useChip
} from "./chunk-P5JPZ5W3.mjs";
// src/chip.tsx
import { CloseFilledIcon } from "@heroui/shared-icons";
import { forwardRef } from "@heroui/system";
import { useMemo } from "react";
import { jsx, jsxs } from "react/jsx-runtime";
var Chip = forwardRef((props, ref) => {
const {
Component,
children,
slots,
classNames,
isDot,
isCloseable,
startContent,
endContent,
getCloseButtonProps,
getChipProps
} = useChip({
...props,
ref
});
const start = useMemo(() => {
if (isDot && !startContent) {
return /* @__PURE__ */ jsx("span", { className: slots.dot({ class: classNames == null ? void 0 : classNames.dot }) });
}
return startContent;
}, [slots, startContent, isDot]);
const end = useMemo(() => {
if (isCloseable) {
return /* @__PURE__ */ jsx("span", { ...getCloseButtonProps(), children: endContent || /* @__PURE__ */ jsx(CloseFilledIcon, {}) });
}
return endContent;
}, [endContent, isCloseable, getCloseButtonProps]);
return /* @__PURE__ */ jsxs(Component, { ...getChipProps(), children: [
start,
/* @__PURE__ */ jsx("span", { className: slots.content({ class: classNames == null ? void 0 : classNames.content }), children }),
end
] });
});
Chip.displayName = "HeroUI.Chip";
var chip_default = Chip;
export {
chip_default
};