@progress/kendo-react-gantt
Version:
React Gantt enables the display of self-referencing tabular data with many features. KendoReact Gantt 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 { useGanttActiveViewContext as v } from "../../../context/GanttContext.mjs";
const w = (e) => {
const [n, i] = v(), a = m(), o = t.useMemo(
() => typeof e.view.title == "function" ? e.view.title.call(void 0, a) : e.view.title,
[e.view.title, a]
), l = t.useCallback(() => {
e.view.name && i(e.view.name);
}, [i, e.view.name]);
return /* @__PURE__ */ t.createElement(
c,
{
role: "button",
type: "button",
tabIndex: -1,
togglable: !0,
selected: e.view.name === n,
onClick: l
},
o
);
};
w.displayName = "KendoReactGanttViewSelectorItem";
export {
w as ViewSelectorItem
};