interface ImageTableProps {
    list: any[];
}

export const ImageTable = ({list = []}: ImageTableProps) => {
    if (!list || list.length === 0) return (
        <ul className="gallery_list">
            <div className="board1_btn w100per" style={{textAlign: "center"}}>
                데이터가 없습니다.
            </div>
        </ul>
    );

    return (
        <ul className="gallery_list">
            {list.map((item) => (
                <li key={item.mazId}>
                    <a href="#" data-mainzone-id={item.mazId}>

                        {item.useYn === "Y" ? (
                            <span className="status primary">사용</span>
                        ) : (
                            <span className="status gray">미사용</span>
                        )}

                        <div className="images_area">
                            <img
                                src={`/uss/ion/pwm/getImage.do?atchFileId=${item.mainzoneImageFile}`}
                                alt=""
                            />
                        </div>

                        <div className="list_content">
                            <b className="list_title">{item.mazNm}</b>
                            <ul className="list_info">
                                <li>작성자 {item.registerId}</li>
                                <li>노출순서 {item.sort}</li>
                                <li>{item.regdt}</li>
                            </ul>
                        </div>
                    </a>
                </li>
            ))}
        </ul>
    );
}