#pragma once

#include "ComponentEditor.hpp"

struct CellGridComponent;

class CellGridEditor : public ComponentEditor<CellGridComponent> {
public:
    bool renderComponent(flecs::entity entity, CellGridComponent& grid) override;
    const char* getName() const override { return "Cell Grid"; }
    
private:
    void renderCellEditor(CellGridComponent& grid);
    void renderFurnitureEditor(CellGridComponent& grid);
    void renderScriptEditor(CellGridComponent& grid);
    void renderTextureRectEditor(flecs::entity entity, CellGridComponent& grid);
    
    // State for UI
    int selectedCellX = 0, selectedCellY = 0, selectedCellZ = 0;
    int newCellX = 0, newCellY = 0, newCellZ = 0;
    char scriptBuffer[16384] = {0};
    bool showGrid = false;
    flecs::entity m_currentEntity = flecs::entity::null();
};
