using Godot;
using System;

namespace SessionZeroApp;

public partial class CustomListViewItem : Panel
{
    [Export] private Label _nameLabel;
    [Export] private Label _typeLabel;
    [Export] private Label _versionLabel;

    public string Guid { get; set; }
    public string ItemName { get; set; }
    public string SzfType { get; set; }
    public string Version { get; set; }
    public Action ViewAction { get; set; }
    public Action EditAction { get; set; }
    public Action DeleteAction { get; set; }

    public void SetupItem(string guid, string itemName, string szfType, string version, Action viewAction, Action editAction, Action deleteAction)
    {
        Guid = guid;
        ItemName = itemName;
        SzfType = szfType;
        Version = version;
        ViewAction = viewAction;
        EditAction = editAction;
        DeleteAction = deleteAction;

        _nameLabel.Text = ItemName;
        _typeLabel.Text = SzfType;
        _versionLabel.Text = Version;
    }
}
