StudyPlanCard.js 1.49 KB
Newer Older
Choi Ga Young's avatar
Choi Ga Young committed
1
import { Link } from "react-router-dom";
Kim, Subin's avatar
Kim, Subin committed
2
import PlanLineList from "./PlanLineList";
Choi Ga Young's avatar
Choi Ga Young committed
3
import DeleteModal from "../Modal/DeleteModal";
Choi Ga Young's avatar
Choi Ga Young committed
4
import style from "./studyplan.module.scss";
Choi Ga Young's avatar
Choi Ga Young committed
5

Choi Ga Young's avatar
Choi Ga Young committed
6
const StudyPlanCard = ({ renList, handleEdit, delSubject }) => {
Kim, Subin's avatar
Kim, Subin committed
7

Choi Ga Young's avatar
Choi Ga Young committed
8
  return (
Choi Ga Young's avatar
Choi Ga Young committed
9
10
11
12
13
14
15
16
17
18
19
20
21
22
    <>
      <Link className="card text-decoration-none link-dark mb-3" to={`/studyplan/${renList.id}`} style={{ width: "20rem" }} >
        <div className="card-body" style={{ height: "150px" }}>
          <div className="d-flex">
            <h5 className="card-title col-10 text-nowrap" style={{ overflow: "hidden", textOverflow: "ellipsis" }}>{renList.name}</h5>
            <div className="col-2 d-flex justify-content-end">
              <Link className="text-decoration-none link-dark" to={`/subject/edit/${renList.id}`}><i className="bi bi-pencil-square pe-2"></i></Link>
              <i className="bi bi-trash" data-bs-toggle="modal" data-bs-target="#deleteModal" onClick={(e) => e.preventDefault()}>
              </i>
            </div>
          </div>
          <p className="card-subtitle ms-1 mb-2 text-muted">{renList.prof && renList.room ? renList.prof + ' - ' + renList.room : (renList.prof || renList.room)}</p>
          <div className={`${style.inCard}`} style={{ height: "60px" }}>
            <PlanLineList subjectId={renList.id} planList={renList.planList} handleClick={handleEdit} />
Choi Ga Young's avatar
Choi Ga Young committed
23
          </div>
Choi Ga Young's avatar
Choi Ga Young committed
24
        </div>
Choi Ga Young's avatar
Choi Ga Young committed
25
26
27
      </Link>
      <DeleteModal handleClick={delSubject} renListID={renList.id} />
    </>
Choi Ga Young's avatar
Choi Ga Young committed
28
29
30
  )
}

Choi Ga Young's avatar
Choi Ga Young committed
31
export default StudyPlanCard;