@progress/kendo-react-scheduler
Version:
React Scheduler brings the functionality of Outlook's Calendar to a single UI component. KendoReact Scheduler package
36 lines (35 loc) • 1.18 kB
JavaScript
/**
* @license
*-------------------------------------------------------------------------------------------
* Copyright © 2025 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the package root for more information
*-------------------------------------------------------------------------------------------
*/
import * as t from "react";
import { Button as c } from "@progress/kendo-react-buttons";
import { useLocalization as m } from "@progress/kendo-react-intl";
import { useSchedulerActiveViewContext as u } from "../../../context/SchedulerContext.mjs";
const b = (e) => {
const [l, i] = u(), o = m(), a = t.useMemo(
() => typeof e.view.title == "function" ? e.view.title.call(void 0, o) : e.view.title,
[e.view.title, o]
), n = t.useCallback(() => {
e.view.name && i(e.view.name);
}, [i, e.view.name]);
return /* @__PURE__ */ t.createElement(
c,
{
className: "k-toolbar-button",
role: "button",
type: "button",
tabIndex: -1,
togglable: !0,
selected: e.view.name === l,
onClick: n
},
a
);
};
export {
b as ViewSelectorItem
};