/*
 * Copyright 2016 - 2025 Gary Talent (gary@drinkingtea.net). All rights reserved.
 */

#pragma once

#include <ox/std/string.hpp>

#include <studio/context.hpp>
#include <studio/popup.hpp>

namespace studio {

class DeleteConfirmation final: public Popup {
 	private:
		enum class Stage {
			Closed,
			Opening,
			Open,
		};
		Stage m_stage = Stage::Closed;
		bool m_open{};
		ox::String m_path;

	public:
		ox::Signal<ox::Error(ox::StringViewCR path)> deleteFile;

		DeleteConfirmation() noexcept;

		void openPath(ox::StringViewCR path) noexcept;

		void open() noexcept override;

		void close() noexcept override;

		[[nodiscard]]
		bool isOpen() const noexcept override;

		void draw(Context &ctx) noexcept override;

};

}
