@backstage-community/plugin-sonarqube
Version:
42 lines (39 loc) • 1.15 kB
JavaScript
import { jsx } from 'react/jsx-runtime';
import Box from '@material-ui/core/Box';
import { ErrorPanel, Table } from '@backstage/core-components';
import { getColumns } from './Columns.esm.js';
import { useTranslationRef } from '@backstage/frontend-plugin-api';
import { sonarqubeTranslationRef } from '../../translation.esm.js';
const SonarQubeTable = ({
tableContent,
title,
options,
emptyContent,
localization
}) => {
const { t } = useTranslationRef(sonarqubeTranslationRef);
if (!tableContent) {
return /* @__PURE__ */ jsx(ErrorPanel, { error: Error("Table could not be rendered") });
}
return /* @__PURE__ */ jsx(
Box,
{
sx: {
overflow: "auto"
},
children: /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
Table,
{
title: /* @__PURE__ */ jsx("div", { children: `(${tableContent.length}) ${title}` }),
options,
data: tableContent || [],
columns: getColumns(t),
emptyContent,
localization
}
) })
}
);
};
export { SonarQubeTable };
//# sourceMappingURL=SonarQubeTable.esm.js.map