import Button from "@material-ui/core/Button"; import Card from "@material-ui/core/Card"; import IconButton from "@material-ui/core/IconButton"; import TableBody from "@material-ui/core/TableBody"; import TableCell from "@material-ui/core/TableCell"; import TableHead from "@material-ui/core/TableHead"; import TableRow from "@material-ui/core/TableRow"; import DeleteIcon from "@material-ui/icons/Delete"; import AppHeader from "@saleor/components/AppHeader"; import Container from "@saleor/components/Container"; import PageHeader from "@saleor/components/PageHeader"; import ResponsiveTable from "@saleor/components/ResponsiveTable"; import Skeleton from "@saleor/components/Skeleton"; import TableCellHeader from "@saleor/components/TableCellHeader"; import { sectionNames } from "@saleor/intl"; import { renderCollection, stopPropagation } from "@saleor/misc"; import React from "react"; import { FormattedMessage, useIntl } from "react-intl"; import { Channels_channels } from "../../types/Channels"; import { useStyles } from "./styles"; export interface ChannelsListPageProps { channelsList: Channels_channels[] | undefined; navigateToChannelCreate: () => void; onBack: () => void; onRowClick: (id: string) => () => void; onRemove: (id: string) => void; } const numberOfColumns = 2; export const ChannelsListPage: React.FC = ({ channelsList, navigateToChannelCreate, onBack, onRemove, onRowClick }) => { const intl = useIntl(); const classes = useStyles({}); return ( {intl.formatMessage(sectionNames.configuration)} {renderCollection( channelsList, channel => ( {channel?.name || } {channelsList?.length > 1 && ( onRemove(channel.id)) : undefined } > )} ), () => ( ) )} ); }; ChannelsListPage.displayName = "ChannelsListPage"; export default ChannelsListPage;