import Card from "@material-ui/core/Card"; import CardContent from "@material-ui/core/CardContent"; import { makeStyles } from "@material-ui/core/styles"; import Typography from "@material-ui/core/Typography"; import React from "react"; import { FormattedMessage, useIntl } from "react-intl"; import CardTitle from "@saleor/components/CardTitle"; import { DateTime } from "@saleor/components/Date"; import { Hr } from "@saleor/components/Hr"; import Skeleton from "@saleor/components/Skeleton"; import { maybe } from "../../../misc"; import { CustomerDetails_user } from "../../types/CustomerDetails"; const useStyles = makeStyles( theme => ({ label: { marginBottom: theme.spacing(1) }, value: { fontSize: 24 } }), { name: "CustomerStats" } ); export interface CustomerStatsProps { customer: CustomerDetails_user; } const CustomerStats: React.FC = props => { const { customer } = props; const classes = useStyles(props); const intl = useIntl(); return ( {maybe( () => ( {customer.lastLogin === null ? ( "-" ) : ( )} ), )}
{maybe( () => ( {customer.lastPlacedOrder.edges.length === 0 ? ( "-" ) : ( )} ), )}
); }; CustomerStats.displayName = "CustomerStats"; export default CustomerStats;