import IconButton from "@material-ui/core/IconButton"; 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 TableHead from "@material-ui/core/TableHead"; import TableRow from "@material-ui/core/TableRow"; import Typography from "@material-ui/core/Typography"; import DeleteIcon from "@material-ui/icons/Delete"; import EditIcon from "@material-ui/icons/Edit"; import React from "react"; import { FormattedMessage } from "react-intl"; import Skeleton from "@saleor/components/Skeleton"; import TablePagination from "@saleor/components/TablePagination"; import { maybe, renderCollection, stopPropagation } from "@saleor/misc"; import { ListProps } from "@saleor/types"; import { ServiceList_serviceAccounts_edges_node } from "../../types/ServiceList"; export interface ServiceListProps extends ListProps { services: ServiceList_serviceAccounts_edges_node[]; onRemove: (id: string) => void; } const styles = theme => createStyles({ [theme.breakpoints.up("lg")]: { colName: { "&&": { width: "auto" } } }, colAction: { "&&": { paddingRight: theme.spacing(1) }, textAlign: "right", width: 100 }, colName: { paddingLeft: 0, width: 250 }, table: { tableLayout: "fixed" }, tableRow: { cursor: "pointer" } }); const numberOfColumns = 2; const ServiceList = withStyles(styles, { name: "ServiceList" })( ({ classes, settings, disabled, onNextPage, onPreviousPage, onUpdateListSettings, onRemove, onRowClick, pageInfo, services }: ServiceListProps & WithStyles) => ( {renderCollection( services, service => ( {maybe(() => service.name, )} {maybe(() => service.isActive ? ( ) : ( ) )} onRemove(service.id)) : undefined } > ), () => ( ) )}
) ); ServiceList.displayName = "ServiceList"; export default ServiceList;