<!doctype html>
<html lang="ko"
      xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>문의 내역</title>
    <link rel="stylesheet" th:href="@{/resources/kr/iotdoor/comn/site/layout/css/bootstrap.min.css}">
    <link rel="stylesheet" th:href="@{/resources/kr/iotdoor/comn/site/layout/css/iotdoor.css?v=202404021718}">
</head>
<body class="bg-light">
<div class="container py-5">
    <div class="d-flex flex-column flex-md-row justify-content-between align-items-md-center gap-3 mb-4">
        <div>
            <h1 class="h3 mb-1">문의 내역</h1>
            <p class="text-secondary mb-0">홈페이지 문의 접수 내용을 MariaDB에서 조회합니다.</p>
        </div>
        <div class="d-flex gap-2">
            <a class="btn btn-outline-secondary" th:href="@{/mfuc/index.do}">대시보드</a>
            <a class="btn btn-outline-primary" th:href="@{/mfuc/portfolio/list.do}">포트폴리오 관리</a>
        </div>
    </div>

    <div class="card border-0 shadow-sm">
        <div class="card-body">
            <div th:if="${#lists.isEmpty(contacts)}" class="text-secondary">
                아직 저장된 문의가 없습니다.
            </div>
            <div th:unless="${#lists.isEmpty(contacts)}" class="table-responsive">
                <table class="table align-middle">
                    <thead>
                    <tr>
                        <th>접수일시</th>
                        <th>이름</th>
                        <th>연락처</th>
                        <th>이메일</th>
                        <th>제목</th>
                        <th>내용</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr th:each="contact : ${contacts}">
                        <td th:text="${#temporals.format(contact.submittedAt, 'yyyy-MM-dd HH:mm')}">2026-04-16 09:00</td>
                        <td th:text="${contact.name}">홍길동</td>
                        <td th:text="${contact.phone}">010-0000-0000</td>
                        <td th:text="${contact.email}">sample@example.com</td>
                        <td th:text="${contact.subject}">문의 제목</td>
                        <td style="min-width: 260px; white-space: pre-wrap;" th:text="${contact.message}">문의 내용</td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>
</body>
</html>
