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-06-19 14:40:52 +00:00
|
|
|
|
|
|
|
import CardTitle from "@saleor/components/CardTitle";
|
|
|
|
import { ControlledCheckbox } from "@saleor/components/ControlledCheckbox";
|
|
|
|
import i18n from "../../../i18n";
|
|
|
|
|
|
|
|
interface StaffStatusProps {
|
|
|
|
data: {
|
|
|
|
isActive: boolean;
|
|
|
|
};
|
|
|
|
disabled: boolean;
|
|
|
|
onChange: (event: React.ChangeEvent<any>) => void;
|
|
|
|
}
|
|
|
|
|
|
|
|
const StaffStatus: React.StatelessComponent<StaffStatusProps> = ({
|
|
|
|
data,
|
|
|
|
disabled,
|
|
|
|
onChange
|
|
|
|
}) => (
|
|
|
|
<Card>
|
|
|
|
<CardTitle title={i18n.t("Account Status")} />
|
|
|
|
<CardContent>
|
|
|
|
<Typography>
|
|
|
|
{i18n.t("If you want to disable this account uncheck the box below")}
|
|
|
|
</Typography>
|
|
|
|
<ControlledCheckbox
|
|
|
|
checked={data.isActive}
|
|
|
|
disabled={disabled}
|
|
|
|
label={i18n.t("User is active", { context: "checkbox label" })}
|
|
|
|
name="isActive"
|
|
|
|
onChange={onChange}
|
|
|
|
/>
|
|
|
|
</CardContent>
|
|
|
|
</Card>
|
|
|
|
);
|
|
|
|
StaffStatus.displayName = "StaffStatus";
|
|
|
|
export default StaffStatus;
|