"use client";

import React from "react";

type TokenExpiredModalProps = {
	open: boolean;
	onClose: () => void;
};

export default function TokenExpiredModal({ open, onClose }: TokenExpiredModalProps) {
	if (!open) return null;

	return (
		<div className="fixed inset-0 z-50 flex items-center justify-center">
			<button
				type="button"
				aria-label="닫기"
				className="absolute inset-0 bg-black/40 cursor-default"
				onClick={onClose}
			/>
			<div
				role="dialog"
				aria-modal="true"
				aria-labelledby="token-expired-title"
				className="relative bg-white box-border flex flex-col items-stretch justify-start p-6 rounded-[8px] min-w-[500px] max-w-[calc(100%-48px)]"
			>
				<div className="text-[18px] leading-normal font-semibold text-neutral-700 mb-8" id="token-expired-title">
					자동 로그아웃 되었습니다.
				</div>
				<div className="flex items-center justify-end gap-[8px]">
					<button
						type="button"
						onClick={onClose}
						className="h-[40px] min-w-20 px-[12px] rounded-[8px] bg-active-button text-white text-[16px] font-semibold cursor-pointer"
					>
						확인
					</button>
				</div>
			</div>
		</div>
	);
}

