@mantine/dates
Version:
Calendars, date and time pickers based on Mantine components
23 lines (22 loc) • 832 B
JavaScript
"use client";
import { padTime } from "../utils/pad-time/pad-time.mjs";
import { useTimePickerContext } from "../TimePicker.context.mjs";
import { jsx } from "react/jsx-runtime";
import { UnstyledButton } from "@mantine/core";
//#region packages/@mantine/dates/src/components/TimePicker/TimeControlsList/TimeControl.tsx
function TimeControl({ value, active, onSelect }) {
const ctx = useTimePickerContext();
return /* @__PURE__ */ jsx(UnstyledButton, {
mod: { active },
onClick: () => onSelect(value),
onMouseDown: (event) => event.preventDefault(),
"data-value": value,
tabIndex: -1,
...ctx.getStyles("control"),
children: typeof value === "number" ? padTime(value) : value
});
}
TimeControl.displayName = "@mantine/dates/TimeControl";
//#endregion
export { TimeControl };
//# sourceMappingURL=TimeControl.mjs.map