@tduniec/backstage-plugin-time-saver
Version:
This plugin provides an implementation of charts and statistics related to your time savings that are coming from usage of your templates. Plugins is built from frontend and backend part. This part of plugin `frontend` is responsible of providing views wi
42 lines (39 loc) • 1.91 kB
JavaScript
import { jsxs, jsx } from 'react/jsx-runtime';
import { useState } from 'react';
import { Tabs, Tab } from '@material-ui/core';
import { Page, Content, ContentHeader, SupportButton } from '@backstage/core-components';
import { AllStatsSubPage } from '../AllStatsSubPage/AllStatsSubPage.esm.js';
import { ByTeamSubPage } from '../ByTeamSubPage/ByTeamSubPage.esm.js';
import { ByTemplateSubPage } from '../ByTemplateSubPage/ByTemplateSubPage.esm.js';
import CustomHeader from '../TimeSaverHeader/TimeSaverHeaderComponent.esm.js';
const TimeSaverPageComponent = (props) => {
const [selectedTab, setSelectedTab] = useState(0);
const handleChange = (_event, _newValue) => {
setSelectedTab(_newValue);
};
return /* @__PURE__ */ jsxs(Page, { themeId: "tool", children: [
/* @__PURE__ */ jsx(
CustomHeader,
{
title: props.title,
subtitle: props.subtitle,
headerLabel: props.headerLabel
}
),
/* @__PURE__ */ jsxs(Content, { children: [
/* @__PURE__ */ jsxs(ContentHeader, { title: "Time Saver", children: [
/* @__PURE__ */ jsxs(Tabs, { value: selectedTab, onChange: handleChange, centered: false, children: [
/* @__PURE__ */ jsx(Tab, { label: "All Stats" }),
/* @__PURE__ */ jsx(Tab, { label: "By Team" }),
/* @__PURE__ */ jsx(Tab, { label: "By Template" })
] }),
/* @__PURE__ */ jsx(SupportButton, { children: "Time Saver plugin retrieves its config from template.metadata and groups it in a dedicated table, then it has a bunch of APIs for data queries" })
] }),
selectedTab === 0 && /* @__PURE__ */ jsx(AllStatsSubPage, {}),
selectedTab === 1 && /* @__PURE__ */ jsx(ByTeamSubPage, {}),
selectedTab === 2 && /* @__PURE__ */ jsx(ByTemplateSubPage, {})
] })
] });
};
export { TimeSaverPageComponent };
//# sourceMappingURL=TimeSaverPageComponent.esm.js.map