ScheduleItem.js 1.72 KB
Newer Older
Kim, Subin's avatar
Kim, Subin committed
1
2
3
import { Link } from "react-router-dom";
import styles from "./schedule.module.scss";

Kim, Subin's avatar
context    
Kim, Subin committed
4
const ScheduleItem = ({ schedule, handleClick }) => {
Kim, Subin's avatar
Kim, Subin committed
5

Kim, Subin's avatar
Kim, Subin committed
6
7
    return (
        <div className="accordion-item border-bottom-0">
Kim, Subin's avatar
context    
Kim, Subin committed
8
9
            <button className={`d-flex flex-column align-items-start accordion-button collapsed bg-white shadow-none px-0 ${styles.activeBtn}`} type="button" data-bs-toggle="collapse" data-bs-target={schedule.id} aria-expanded="false" aria-controls={schedule.id}>
                <h5 className={`accordion-header ${styles.title}`} id={"heading" + schedule.id}>{schedule.title}</h5>
Kim, Subin's avatar
Kim, Subin committed
10
11
                <p className={`text-secondary mb-0 ${styles.time}`}>sadsadsdsadsadsaf</p>
                <p className={`mb-0 ${styles.period}`}>2021.01.151 ~ 2021.09.35</p>
Kim, Subin's avatar
Kim, Subin committed
12
            </button>
Kim, Subin's avatar
context    
Kim, Subin committed
13
            <div id={schedule.id} className="accordion-collapse collapse" aria-labelledby={"heading" + schedule.id} data-bs-parent="#scheduleList">
Kim, Subin's avatar
Kim, Subin committed
14
                <div className={`accordion-body px-0 pt-2 pb-0 mb-3 ${styles.textBox}`}>
Kim, Subin's avatar
context    
Kim, Subin committed
15
                    {schedule.location ? <div className="d-flex align-items-start">
Kim, Subin's avatar
Kim, Subin committed
16
                        <i className="col bi bi-geo-alt fs-5"></i>
Kim, Subin's avatar
context    
Kim, Subin committed
17
18
19
                        <div className="col-11">{schedule.location}</div>
                    </div> : null}
                    {schedule.memo}
Kim, Subin's avatar
Kim, Subin committed
20
                    <div className="d-flex justify-content-end mt-3">
Kim, Subin's avatar
context    
Kim, Subin committed
21
22
                        <Link className="btn btn-light btn-sm border-dark" to={`/schedule/edit/${schedule.id}`}>수정</Link>
                        <button type="button" className="btn btn-crimson btn-sm ms-2" onClick={handleClick}>삭제</button>
Kim, Subin's avatar
Kim, Subin committed
23
24
25
26
27
28
29
30
                    </div>
                </div>
            </div>
        </div>
    )
}

export default ScheduleItem