import React, {useEffect, useState} from "react";
import {Button, Modal, Nav} from "react-bootstrap";
import Col from "react-bootstrap/Col";
import Row from "react-bootstrap/Row";
import * as EgovNet from "api/egovFetch";


function HistoryModal({closeFn, standardCode}){

    return(
        <>
            <Modal.Header closeButton>
                <Modal.Title id="example-modal-sizes-title-lg">개정이력</Modal.Title>
            </Modal.Header>
            <Modal.Body>
                <div>코드 : {standardCode.kcscCd}</div>
                <div className="board_list standard_code_modal">
                    <div className="head">
                        <span>고시일</span>
                        <span>기준코드</span>
                        <span>신구건설기준비교</span>
                    </div>
                    <div className={"result"}>
                        {standardCode.historyList.filter(history => {
                            return history;
                        }).map(history => {
                            return (
                                <div className="list_item">
                                    <div className="mainCategory">{history.rvsnYmd.split('T')[0]}</div>
                                    <div className="middleCategory">
                                        <Button size={"sm"} variant={"outline-secondary"}>다운로드</Button>
                                    </div>
                                    <div className="kcscCd">
                                        <Button size={"sm"} variant={"outline-secondary"}>다운로드</Button>
                                    </div>
                                </div>
                            )
                        })}
                    </div>
                </div>
            </Modal.Body>
            <Modal.Footer><Button onClick={closeFn}>닫기</Button></Modal.Footer>
        </>
    )
}

export default HistoryModal;