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

42 lines
978 B
Plaintext

import {
useSeparator
} from "./chunk-D2EG5U3Q.mjs";
// src/use-divider.ts
import { divider } from "@heroui/theme";
import { useCallback, useMemo } from "react";
function useDivider(props) {
const { as, className, orientation, ...otherProps } = props;
let Component = as || "hr";
if (Component === "hr" && orientation === "vertical") {
Component = "div";
}
const { separatorProps } = useSeparator({
elementType: typeof Component === "string" ? Component : "hr",
orientation
});
const styles = useMemo(
() => divider({
orientation,
className
}),
[orientation, className]
);
const getDividerProps = useCallback(
(props2 = {}) => ({
className: styles,
role: "separator",
"data-orientation": orientation,
...separatorProps,
...otherProps,
...props2
}),
[styles, orientation, separatorProps, otherProps]
);
return { Component, getDividerProps };
}
export {
useDivider
};