2019-08-09 10:17:04 +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:17:04 +00:00
|
|
|
import React from "react";
|
2019-08-16 11:47:30 +00:00
|
|
|
import { FormattedMessage, useIntl } from "react-intl";
|
2019-08-09 10:17:04 +00:00
|
|
|
|
2019-08-16 11:47:30 +00:00
|
|
|
import { sectionNames } from "@saleor/intl";
|
2019-08-09 10:17:04 +00:00
|
|
|
import Container from "../../../components/Container";
|
|
|
|
import PageHeader from "../../../components/PageHeader";
|
|
|
|
import { ListActions, PageListProps } from "../../../types";
|
|
|
|
import { AttributeList_attributes_edges_node } from "../../types/AttributeList";
|
|
|
|
import AttributeList from "../AttributeList/AttributeList";
|
|
|
|
|
|
|
|
export interface AttributeListPageProps extends PageListProps, ListActions {
|
|
|
|
attributes: AttributeList_attributes_edges_node[];
|
|
|
|
}
|
|
|
|
|
|
|
|
const AttributeListPage: React.FC<AttributeListPageProps> = ({
|
|
|
|
onAdd,
|
|
|
|
...listProps
|
2019-08-16 11:47:30 +00:00
|
|
|
}) => {
|
|
|
|
const intl = useIntl();
|
|
|
|
|
|
|
|
return (
|
|
|
|
<Container>
|
2019-08-22 16:19:16 +00:00
|
|
|
<PageHeader title={intl.formatMessage(sectionNames.attributes)}>
|
2019-08-16 11:47:30 +00:00
|
|
|
<Button onClick={onAdd} color="primary" variant="contained">
|
|
|
|
<FormattedMessage
|
2019-09-05 13:33:50 +00:00
|
|
|
defaultMessage="Create attribute"
|
2019-08-16 11:47:30 +00:00
|
|
|
description="button"
|
|
|
|
/>
|
|
|
|
</Button>
|
|
|
|
</PageHeader>
|
|
|
|
<Card>
|
|
|
|
<AttributeList {...listProps} />
|
|
|
|
</Card>
|
|
|
|
</Container>
|
|
|
|
);
|
|
|
|
};
|
2019-08-09 10:17:04 +00:00
|
|
|
AttributeListPage.displayName = "AttributeListPage";
|
|
|
|
export default AttributeListPage;
|