2019-06-19 14:40:52 +00:00
|
|
|
import Card from "@material-ui/core/Card";
|
|
|
|
import CardContent from "@material-ui/core/CardContent";
|
|
|
|
import Typography from "@material-ui/core/Typography";
|
2019-08-09 10:26:22 +00:00
|
|
|
import React from "react";
|
2019-08-26 21:43:29 +00:00
|
|
|
import { FormattedMessage, useIntl } from "react-intl";
|
2019-06-19 14:40:52 +00:00
|
|
|
|
|
|
|
import CardTitle from "@saleor/components/CardTitle";
|
|
|
|
import { ControlledCheckbox } from "@saleor/components/ControlledCheckbox";
|
|
|
|
|
|
|
|
interface StaffStatusProps {
|
|
|
|
data: {
|
|
|
|
isActive: boolean;
|
|
|
|
};
|
|
|
|
disabled: boolean;
|
2019-10-04 10:57:40 +00:00
|
|
|
label: React.ReactNode;
|
2019-06-19 14:40:52 +00:00
|
|
|
onChange: (event: React.ChangeEvent<any>) => void;
|
|
|
|
}
|
|
|
|
|
2019-11-07 11:34:54 +00:00
|
|
|
const StaffStatus: React.FC<StaffStatusProps> = ({
|
2019-06-19 14:40:52 +00:00
|
|
|
data,
|
|
|
|
disabled,
|
2019-10-04 10:57:40 +00:00
|
|
|
label,
|
2019-06-19 14:40:52 +00:00
|
|
|
onChange
|
2019-08-26 21:43:29 +00:00
|
|
|
}) => {
|
|
|
|
const intl = useIntl();
|
|
|
|
|
|
|
|
return (
|
|
|
|
<Card>
|
|
|
|
<CardTitle
|
|
|
|
title={intl.formatMessage({
|
|
|
|
defaultMessage: "Account Status",
|
|
|
|
description: "section header"
|
|
|
|
})}
|
2019-06-19 14:40:52 +00:00
|
|
|
/>
|
2019-08-26 21:43:29 +00:00
|
|
|
<CardContent>
|
|
|
|
<Typography>
|
|
|
|
<FormattedMessage defaultMessage="If you want to disable this account uncheck the box below" />
|
|
|
|
</Typography>
|
|
|
|
<ControlledCheckbox
|
|
|
|
checked={data.isActive}
|
|
|
|
disabled={disabled}
|
2019-10-04 10:57:40 +00:00
|
|
|
label={label}
|
2019-08-26 21:43:29 +00:00
|
|
|
name="isActive"
|
|
|
|
onChange={onChange}
|
|
|
|
/>
|
|
|
|
</CardContent>
|
|
|
|
</Card>
|
|
|
|
);
|
|
|
|
};
|
2019-06-19 14:40:52 +00:00
|
|
|
StaffStatus.displayName = "StaffStatus";
|
|
|
|
export default StaffStatus;
|