saleor-dashboard/src/orders/components/OrderDraftListPage/OrderDraftListPage.tsx

48 lines
1.4 KiB
TypeScript
Raw Normal View History

2019-06-19 14:40:52 +00:00
import Button from "@material-ui/core/Button";
import Card from "@material-ui/core/Card";
2019-09-10 12:11:47 +00:00
2019-08-09 10:26:22 +00:00
import React from "react";
import { FormattedMessage, useIntl } from "react-intl";
2019-06-19 14:40:52 +00:00
import Container from "@saleor/components/Container";
import PageHeader from "@saleor/components/PageHeader";
import { sectionNames } from "@saleor/intl";
2019-08-09 11:14:35 +00:00
import { ListActions, PageListProps } from "@saleor/types";
2019-06-19 14:40:52 +00:00
import { OrderDraftList_draftOrders_edges_node } from "../../types/OrderDraftList";
import OrderDraftList from "../OrderDraftList";
export interface OrderDraftListPageProps extends PageListProps, ListActions {
orders: OrderDraftList_draftOrders_edges_node[];
}
const OrderDraftListPage: React.StatelessComponent<OrderDraftListPageProps> = ({
disabled,
onAdd,
...listProps
}) => {
const intl = useIntl();
return (
<Container>
<PageHeader title={intl.formatMessage(sectionNames.draftOrders)}>
<Button
color="primary"
variant="contained"
disabled={disabled}
onClick={onAdd}
>
<FormattedMessage
defaultMessage="Create order"
description="button"
/>
</Button>
</PageHeader>
<Card>
<OrderDraftList disabled={disabled} {...listProps} />
</Card>
</Container>
);
};
2019-06-19 14:40:52 +00:00
OrderDraftListPage.displayName = "OrderDraftListPage";
export default OrderDraftListPage;