"use client";

import { useState } from "react";
import IdFindDone from "./IdFindDone";
import IdFindFailed from "./IdFindFailed";
import FindIdOption from "./FindIdOption";
import FindIdDevOption from "./FindIdDevOption";

export default function FindIdPage() {
	const [isDoneOpen, setIsDoneOpen] = useState(false);
	const [isFailedOpen, setIsFailedOpen] = useState(false);
	const [foundUserId, setFoundUserId] = useState<string | undefined>(undefined);

	return (
		<div className="min-h-screen w-full flex flex-col items-center justify-between">
			<IdFindDone
				on={isDoneOpen}
				userId={foundUserId}
				onClose={() => setIsDoneOpen(false)}
			/>
			<IdFindFailed
				on={isFailedOpen}
				onClose={() => setIsFailedOpen(false)}
			/>

			<FindIdOption
				onOpenDone={(id) => {
					setFoundUserId(id);
					setIsDoneOpen(true);
				}}
				onOpenFailed={() => {
					setIsFailedOpen(true);
				}}
			/>

			<FindIdDevOption
				doneEnabled={isDoneOpen}
				setDoneEnabled={setIsDoneOpen}
				failedEnabled={isFailedOpen}
				setFailedEnabled={setIsFailedOpen}
			/>

			<p className="text-center py-[40px] text-[15px] text-basic-text">
				Copyright ⓒ 2025 XL LMS. All rights reserved
			</p>
		</div>
	);
}


