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 Alert from "@saleor/components/Alert/Alert"; 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 { RefreshLimits_shop_limits } from "@saleor/components/Shop/types/RefreshLimits"; import Skeleton from "@saleor/components/Skeleton"; import TableCellHeader from "@saleor/components/TableCellHeader"; import { sectionNames } from "@saleor/intl"; import { renderCollection, stopPropagation } from "@saleor/misc"; import { hasLimits, isLimitReached } from "@saleor/utils/limits"; 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; limits: RefreshLimits_shop_limits; navigateToChannelCreate: () => void; onBack: () => void; onRowClick: (id: string) => () => void; onRemove: (id: string) => void; } const numberOfColumns = 2; export const ChannelsListPage: React.FC = ({ channelsList, limits, navigateToChannelCreate, onBack, onRemove, onRowClick }) => { const intl = useIntl(); const classes = useStyles({}); const limitReached = isLimitReached(limits, "channels"); return ( {intl.formatMessage(sectionNames.configuration)} {renderCollection( channelsList, channel => ( {channel?.name || } {channelsList?.length > 1 && ( onRemove(channel.id)) : undefined } > )} ), () => ( ) )} ); }; ChannelsListPage.displayName = "ChannelsListPage"; export default ChannelsListPage;