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

#pragma once

#include <ox/std/string.hpp>

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

namespace studio {

class FileInfo: public ig::Popup {
	private:
		Context &m_sctx;
		ox::String m_filePath;
		struct Info {
			ox::UUIDStr assetId;
			ox::String typeName;
			int typeVersion{};
			ox::StringLiteral format;
			// use manual sizing to work with %ull
			unsigned long long dataSize{};
		};
		ox::Optional<Info> m_fileInfo;

	public:
		explicit FileInfo(Context &sctx) noexcept;

		ox::Error open(ox::StringParam filePath) noexcept;

		void draw(Context &sctx) noexcept override;

	private:
		void drawTable() const noexcept;

};

}