import { Link } from "react-router-dom";
import styles from "./studyplan.module.scss";

const PlanLineList = ({ subjectId, planList = [] }) => {
    return (
        <Link to={`/studyplan/${subjectId}`}>
            {planList.length !== 0 ? planList.map(plan => <div className="d-flex justify-content-between">
                <p className={`card-text mb-1 ${styles.text}`}>- {plan.title}</p>
                <input className={`form-check-input shadow-none ${styles.checkBox}`} type="checkbox" />
            </div>) : <Link className="text-decoration-none link-dark" to={`/studyplan/submit/${subjectId}`}>
            <div className="d-flex">
              <i className="bi bi-plus"></i>
              <p className="card-text mb-1">새로운 계획 추가하기</p>
            </div>
          </Link>}
        </Link>
    )
}

export default PlanLineList