import React from "react";

import { Card, CardImageHeader } from "../../../atoms/card";
import {
  FormCheck,
  FormLabel,
  FormCheckInput,
  FormText,
} from "../../../atoms/form";
import Zoom from "react-medium-image-zoom";

const CheckboxImage = (props) => {
  if (props.success) {
    return (
      <Card background="#E9FFF9" {...props}>
        <FormLabel success>
          <Zoom>
            <CardImageHeader {...props} />
          </Zoom>
          <FormCheck textCenter>
            <FormCheckInput {...props} type="checkbox" />
            <FormText success>{props.text}</FormText>
          </FormCheck>
        </FormLabel>
      </Card>
    );
  } else if (props.warning) {
    return (
      <Card background="#FFF4E6" {...props}>
        <FormLabel warning>
          <Zoom>
            <CardImageHeader {...props} />
          </Zoom>
          <FormCheck textCenter>
            <FormCheckInput {...props} type="checkbox" />
            <FormText warning>{props.text}</FormText>
          </FormCheck>
        </FormLabel>
      </Card>
    );
  }
  return (
    <Card {...props}>
      <FormLabel>
        <Zoom>
          <CardImageHeader {...props} />
        </Zoom>
        <FormCheck textCenter>
          <FormCheckInput {...props} type="checkbox" />
        </FormCheck>
      </FormLabel>
    </Card>
  );
};

export default CheckboxImage;
