@kopexa/sight
Version:
Kopexa Sight Design System — React component library for GRC applications
27 lines (24 loc) • 661 B
JavaScript
"use client";
// src/components/code/code.tsx
import { mapPropsVariants, objectToDeps } from "@kopexa/shared-utils";
import { code } from "@kopexa/theme";
import { useMemo } from "react";
import { jsx } from "react/jsx-runtime";
var Code = (originalProps) => {
const [props, variantProps] = mapPropsVariants(
originalProps,
code.variantKeys
);
const { children, className, ...otherProps } = props;
const styles = useMemo(
() => code({
...variantProps,
className
}),
[objectToDeps(variantProps), className]
);
return /* @__PURE__ */ jsx("code", { className: styles, ...otherProps, children });
};
export {
Code
};