import React from "react";
import PropTypes from "prop-types";

const ApplyForAdThirdStage = ({
  onIncreaseStage,
  onDecreaseStage,
  linkedinLink,
  setLinkedinLink,
  githubLink,
  setGithubLink,
  bitBucketLink,
  setBitBucketLink,
  email,
  setEmail,
}) => {
  const disabled =
    linkedinLink.length === 0 ||
    githubLink.length === 0 ||
    bitBucketLink.length === 0;

  return (
    <div>
      <div className="apply-for-ad-header-title">
        <p>Društvene mreže</p>
      </div>
      <div className="apply-for-ad-modal-form-control">
        <label>LinkedIn</label>
        <input
          type="text"
          value={linkedinLink}
          data-testid="apply-for-ad-modal-third-stage-linkedin-input"
          onChange={(e) => setLinkedinLink(e.target.value)}
          placeholder="ex. https://www.linkedin.com/in/petar-petrovic"
        />
      </div>
      <div className="apply-for-ad-modal-form-control">
        <label>GitHub</label>
        <input
          type="text"
          value={githubLink}data-testid="apply-for-ad-modal-third-stage-github-input"
          onChange={(e) => setGithubLink(e.target.value)}
          placeholder="ex. https://www.github.com/petarpetrovic"
        />
      </div>
      <div className="apply-for-ad-modal-form-control">
        <label>BitBucket</label>
        <input
          type="text"
          value={bitBucketLink}data-testid="apply-for-ad-modal-third-stage-bitbucket-input"
          onChange={(e) => setBitBucketLink(e.target.value)}
          placeholder="ex. https://developer.atlassian.com/user/petarapetrovic"
        />
      </div>
      <div className="apply-for-ad-modal-form-control">
        <label>Email</label>
        <input
          type="email"
          value={email}data-testid="apply-for-ad-modal-third-stage-email-input"
          onChange={(e) => setEmail(e.target.value)}
          placeholder="ex. petar.petrovic@dilig.net"
        />
      </div>
      <div className="apply-for-ad-buttons">
        <button onClick={onDecreaseStage}data-testid="apply-for-ad-modal-third-stage-go-back-button">NAZAD</button>
        <button onClick={onIncreaseStage} disabled={disabled}data-testid="apply-for-ad-modal-third-stage-go-forward-button">
          NASTAVI
        </button>
      </div>
    </div>
  );
};

ApplyForAdThirdStage.propTypes = {
  linkedinLink: PropTypes.string,
  setLinkedinLink: PropTypes.any,
  githubLink: PropTypes.string,
  setGithubLink: PropTypes.any,
  bitBucketLink: PropTypes.string,
  setBitBucketLink: PropTypes.any,
  email: PropTypes.string,
  setEmail: PropTypes.any,
  onIncreaseStage: PropTypes.any,
  onDecreaseStage: PropTypes.any,
};

export default ApplyForAdThirdStage;
