import React, { useState } from 'react';
import {Link, useNavigate} from 'react-router-dom';

import * as EgovNet from 'api/egovFetch';
import URL from 'constants/url';

import Row from 'react-bootstrap/Row';
import Col from 'react-bootstrap/Col';
import Button from 'react-bootstrap/Button';

function Detail(){
    const navigate = useNavigate();

    const goToList = () => {
        navigate('/support/list/KCSC-QA');
    };

    const goToCreate = () => {
        navigate('/support/create/KCSC-QA');
    };

    return (
        <div className="container">
            <div className="c_wrap">
                {/* <!-- Location --> */}
                <div className="location">
                    <ul>
                        <li><Link to={URL.MAIN} className="home" >Home</Link></li>
                        <li><Link to={URL.SUPPORT}>정보제공</Link></li>
                        <li>게시판명</li>
                    </ul>
                </div>
                {/* <!--// Location --> */}

                <div className="layout">
                    <div className="contents QNA_LIST" id="contents">
                        {/* <!-- 본문 --> */}
                        <h1 className="tit_3">게시판명</h1>

                        <div className="board_view2">
                            <dl>
                                <dt>카테고리</dt>
                                <dd>
                                    설계기준 > 시설물편 > 건축 구조기준 > 건축물 설계하중
                                </dd>
                                <dt>등록일자</dt>
                                <dd>
                                    2011-08-08 11:11:11
                                </dd>
                            </dl>
                            <dl>
                                <dt>작성자</dt>
                                <dd>
                                    박성환
                                </dd>
                                <dt>조회</dt>
                                <dd>
                                    100
                                </dd>
                            </dl>
                            <dl>
                                <dt>첨부파일</dt>
                                <dd>
                                    <span className="file_attach">
                                        <Link to="">file_name.hwp</Link> <span>[3626] byte</span>
                                    </span>
                                </dd>
                            </dl>
                            <dl>
                                <dd>[공지] jsp파일을 못찼습니다. 제목 뿌려주세요.</dd>
                            </dl>
                        </div>
                        <div className="qna_q">
                            <span>Q</span>
                            안녕하세요 웹호스팅에 올렸더니 jsp파일에서 이런에러로그가 남았는데요 jsp파일을 못찾는것같습니다? xml을 수정해야하나요?<br/>
                            심각: Servlet.service() for servlet action threw exception<br/>
                            javax.servlet.ServletException: Could not get RequestDispatcher for [/WEB-INF/jsp/egovframework//main/main.jsp]: check that
                            this file exists within your WAR<br/>
                            at org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:217)
                        </div>
                        <div className="qna_a">
                            <span>A</span>
                            <ul>
                                <li>
                                    {/*답변 처리중인경우*/}
                                    {/*질문 확인 후 답변을 처리중입니다.*/}

                                    {/*답변 달린경우*/}
                                    <span>admin님의 답변 2011-08-08 12:33:33</span>
                                    심각: Servlet.service() for servlet action threw exception은 jsp파일을 열어서 보셔야합니다.
                                    javax.servlet.ServletException: Could not get RequestDispatcher for [/WEB-INF/jsp/egovframework//main/main.jsp]: check that
                                    this file exists within your WAR
                                </li>
                            </ul>
                        </div>

                        <Row className={"py-3 justify-content-between"} >
                            <Col><Button type={"button"} className={"btn btn-22498E px-4"}  onClick={goToList} >목록</Button></Col>
                            <Col className={"text-end"}><Button type={"button"} className={"btn btn-22498E px-4"}  onClick={goToCreate} >수정</Button></Col>
                        </Row>



                        {/* <!-- 답변달기 관리자에서 설정된 경우만--> */}
                        <Row className="replay justify-content-between">
                            <Col xs={1} className="text-center">
                                <label htmlFor="replay_write">Comment</label>
                            </Col>
                            <Col xs={10} className="">
                                {/*<div>*/}
                                    <textarea className="f_txtar w-100 h-100" name="" id="replay_write" rows="4"></textarea>
                                {/*</div>*/}
                            </Col>
                            <Col xs={1} className="">
                                <Button type={"button"} className="btn btn-22498E w-100 h-100" >등록</Button>
                            </Col>
                        </Row>
                        {/* <!--// 답변달기 --> */}
                        <div className="qna_a">
                            <ul>
                                <li>
                                    <span>chanjin, 2011-08-08 12:33:33</span>
                                    심각: Servlet.service() for servlet action threw exception은 jsp파일을 열어서 보셔야합니다.<br />
                                    javax.servlet.ServletException: Could not get RequestDispatcher for [/WEB-INF/jsp/egovframework//main/main.jsp]: check that<br />
                                    <Link to="#" className="btn delete">삭제</Link>
                                </li>
                                <li>
                                    <span>sunrise, 2011-08-07 11:11:11</span>
                                    tomcat서버를 재시동해보세요. 전 그렇게 하니깐 되던데요.
                                    <Link to="#" className="btn delete">삭제</Link>
                                </li>
                                <li>
                                    <span>auto, 2011-08-07 11:11:11</span>
                                    제가 살펴볼께요 메일로 주세요. test@naver.com
                                    <Link to="#" className="btn delete">삭제</Link>
                                </li>
                            </ul>
                        </div>

                        {/* <!--// 본문 --> */}
                    </div>
                </div>
            </div>
        </div>
    );
}

export default Detail;