Files
NapCatQQ/.pnpm-store/v3/files/4a/cd6611e46f04888e2a7350ab394c1d48a85c578bc930dd796b63a3e96343ed2470cbe341b018d3aac14a9352a32e017af89530ba06d402fc472c0a7a705afe
TanTan e311ca3275
Build NapCat Artifacts / Windows Loader Test (push) Canceled after 0s
Build NapCat Artifacts / Type Check & Test (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Framework (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Shell (push) Canceled after 0s
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

29 lines
730 B
Plaintext

// src/use-code.ts
import { code } from "@heroui/theme";
import { mapPropsVariants } from "@heroui/system-rsc";
import { useMemo } from "react";
import { objectToDeps } from "@heroui/shared-utils";
function useCode(originalProps) {
const [props, variantProps] = mapPropsVariants(originalProps, code.variantKeys);
const { as, children, className, ...otherProps } = props;
const Component = as || "code";
const classNames = useMemo(
() => code({
...variantProps,
className
}),
[objectToDeps(variantProps), className]
);
const getCodeProps = () => {
return {
className: classNames,
...otherProps
};
};
return { Component, children, getCodeProps };
}
export {
useCode
};