namespace Pilz.UI.Controls.ConfigurationManager;

public class ConfigurationPanel : TableLayoutPanel
{
    private readonly List<ConfigurationEntry> entries = [];

    public ConfigurationEntry CreateEntry(string name, string title)
    {
        return CreateEntry(name, title, null);
    }

    public ConfigurationEntry CreateEntry(string name, string title, Action? create)
    {
        throw new NotImplementedException();
        //return CreateEntry(new(name, title, ));
    }

    public ConfigurationEntry CreateEntry(ConfigurationEntry entry)
    {
        entries.Add(entry);
        return entry;
    }

    internal protected void Build(ConfigurationManager manager)
    {
        foreach (var entry in entries)
        {
            //var control = ;
            //entry.Listener.Initialize();
            // ...
        }
    }
}
