using ClawdDotNet.Services;

namespace ClawdDotNet;

public sealed partial class frm_CreateInstance : Form
{
    public string InstanceName => txtName.Text.Trim();

    public frm_CreateInstance()
    {
        InitializeComponent();
    }

    private void OnTxtNameTextChanged(object? sender, EventArgs e)
    {
        var name = txtName.Text.Trim();
        lblPreview.Text = string.IsNullOrWhiteSpace(name)
            ? "Ordner: Instance-..."
            : $"Ordner: {InstanceDirectoryManager.BuildInstanceFolderName(name)}";
    }
}
