@hitachivantara/uikit-react-core
Version:
Core React components for the NEXT Design System.
56 lines (55 loc) • 1.33 kB
JavaScript
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
import { createClasses } from "@hitachivantara/uikit-react-utils";
import { HvTypography } from "../../Typography/Typography.js";
import { HvBaseSwitch } from "../../BaseSwitch/BaseSwitch.js";
const switchStyle = {
cursor: "pointer",
display: "inline-flex",
marginLeft: "10px"
};
const { useClasses } = createClasses("HvSwitchColumnCell", {
switchNo: switchStyle,
switchYes: switchStyle
});
const HvSwitchColumnCell = ({
checked,
value,
switchLabel,
falseLabel,
trueLabel,
switchProps
}) => {
const { classes } = useClasses();
return /* @__PURE__ */ jsxs(Fragment, { children: [
falseLabel != null && /* @__PURE__ */ jsx(
HvTypography,
{
"aria-hidden": "true",
variant: "body",
className: classes.switchNo,
children: falseLabel
}
),
/* @__PURE__ */ jsx(
HvBaseSwitch,
{
checked,
value,
...switchProps,
inputProps: { "aria-label": switchLabel, ...switchProps?.inputProps }
}
),
trueLabel != null && /* @__PURE__ */ jsx(
HvTypography,
{
"aria-hidden": "true",
variant: "body",
className: classes.switchYes,
children: trueLabel
}
)
] });
};
export {
HvSwitchColumnCell
};