"use client";

import React from "react";
import { NoticeItem } from "./types";

interface NoticeListProps {
  items: NoticeItem[];
  onMoreClick: () => void;
}

export function NoticeList({ items, onMoreClick }: NoticeListProps) {
  return (
    <div className="pop-dashboard-card">
      <div className="pop-dashboard-card-header">
        <h3 className="pop-dashboard-card-title">공지사항</h3>
        <button className="pop-dashboard-btn-more" onClick={onMoreClick}>
          더보기
        </button>
      </div>
      <div className="pop-dashboard-notice-list">
        {items.map((item) => (
          <div key={item.id} className="pop-dashboard-notice-item">
            <div className="pop-dashboard-notice-title">{item.title}</div>
            <div className="pop-dashboard-notice-date">{item.date}</div>
          </div>
        ))}
      </div>
    </div>
  );
}

