StudyPlanCard.js 1.13 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

Choi Ga Young's avatar
Choi Ga Young committed
4
const StudyPlanCard = ({ renList, handleClick, handleEdit }) => {
Kim, Subin's avatar
Kim, Subin committed
5

Choi Ga Young's avatar
Choi Ga Young committed
6
  return (
Kim, Subin's avatar
Kim, Subin committed
7
    <Link className="card text-decoration-none link-dark mb-3" to={`/studyplan/${renList.id}`} style={{ width: "20rem" }} >
Kim, Subin's avatar
Kim, Subin committed
8
9
10
11
12
      <div className="card-body">
        <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>
Kim, Subin's avatar
Kim, Subin committed
13
            <i className="bi bi-trash" onClick={(e) => handleClick(e, renList.id)}>
Kim, Subin's avatar
Kim, Subin committed
14
            </i>
Choi Ga Young's avatar
Choi Ga Young committed
15
          </div>
Choi Ga Young's avatar
Choi Ga Young committed
16
        </div>
Kim, Subin's avatar
Kim, Subin committed
17
        <p className="card-subtitle ms-1 mb-2 text-muted">{renList.prof && renList.room ? renList.prof + ' - ' + renList.room : (renList.prof || renList.room)}</p>
Choi Ga Young's avatar
Choi Ga Young committed
18
        <PlanLineList subjectId={renList.id} planList={renList.planList} handleClick={handleEdit} />
Kim, Subin's avatar
Kim, Subin committed
19
      </div>
Kim, Subin's avatar
Kim, Subin committed
20
    </Link>
Choi Ga Young's avatar
Choi Ga Young committed
21
22
23
  )
}

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