import Card from "@material-ui/core/Card"; import { createStyles, Theme, withStyles, WithStyles } from "@material-ui/core/styles"; import Table from "@material-ui/core/Table"; import TableBody from "@material-ui/core/TableBody"; import TableCell from "@material-ui/core/TableCell"; import TableFooter from "@material-ui/core/TableFooter"; import TableRow from "@material-ui/core/TableRow"; import EditIcon from "@material-ui/icons/Edit"; import React from "react"; import Checkbox from "@saleor/components/Checkbox"; import Skeleton from "@saleor/components/Skeleton"; import StatusLabel from "@saleor/components/StatusLabel"; import TableHead from "@saleor/components/TableHead"; import TablePagination from "@saleor/components/TablePagination"; import i18n from "@saleor/i18n"; import { maybe, renderCollection } from "@saleor/misc"; import { ListActionsWithoutToolbar, ListProps } from "@saleor/types"; import { PluginConfigurations_pluginConfigurations_edges_node } from "../../types/pluginConfigurations"; export interface PluginListProps extends ListProps, ListActionsWithoutToolbar { plugins: PluginConfigurations_pluginConfigurations_edges_node[]; } const styles = (theme: Theme) => createStyles({ [theme.breakpoints.up("lg")]: { colAction: { "& svg": { color: theme.palette.primary.main }, textAlign: "right" }, colActive: {}, colName: {} }, colAction: {}, colActive: {}, colName: {}, link: { cursor: "pointer" } }); const numberOfColumns = 4; const PluginList = withStyles(styles, { name: "PluginList" })( ({ classes, settings, plugins, disabled, onNextPage, pageInfo, onRowClick, onUpdateListSettings, onPreviousPage, isChecked, selected, toggle, toggleAll }: PluginListProps & WithStyles) => { return ( {i18n.t("Name", { context: "table header" })} {i18n.t("Active", { context: "table header" })} {i18n.t("Action", { context: "table header" })} {renderCollection( plugins, plugin => { const isSelected = plugin ? isChecked(plugin.id) : false; return ( toggle(plugin.id)} /> {maybe(() => plugin.name, )} {maybe( () => ( ), )}
); }, () => ( {i18n.t("No plugins found")} ) )}
); } ); PluginList.displayName = "PluginList"; export default PluginList;