Best way to handle multiple buttons? (C#)

Hello, I have a question: What would be the best way to handle multiple buttons?

I am making a directory book. It has 14 tabs(A-B, C-D, E-F, etc.) and on each tab, there are multiple names which effectively are buttons. Each button is activating the same panel but with different text depending on what button was clicked (Name Adrian will open a panel with Adrian text, and name Beatrice would open the same panel but text would be Beatrice). The problem is that this Directory is not going to be populated once, it’s going to have different names, and sometimes the same names will open different text depending on a level you are in. I am looking for the best way to handle all the buttons, number of which would be like 100+.

The best thing I did come up with is making huge switch statement and comparing button texts in it. But that’s kind of tedious and I don’t know how’s the performance of such abomination. I was also thinking about making Vertical Layout Group and populating it with buttons, but I can’t quite wrap my head around that as I would need separate scripts for each level, also every button will have different text so wouldn’t that be as much hassle as switch statement?

Actually… now when I think of it, it’s enough for me to check the name of the button and store it in a string, and then just load text from the file of the same name and assign it to be a text of my panel. 3 lines of code, that’s it. Thanks, my rubber duck. I will leave it as it is, maybe it will help someone in the future. I still have to manually make all the buttons, but I think it’s fine. Unless someone got any suggestion.

    public void OnClickButton()
    {
        Text panelText = panel.GetComponentInChildren<Text>();

        string buttonName = EventSystem.current.currentSelectedGameObject.name;
        TextAsset txtAsset = (TextAsset)Resources.Load(buttonName);

        panelText.text = txtAsset.text;

        if (!panel.activeInHierarchy)
        {
            panel.SetActive(true);
        }  
    }

This may help!

instantiates buttons, renames them according to your requirement etc. My only issue which ive posted at the moment is ensuring the right button enables the correct game object visible. (see my thread) but i think that will do exactly what you want!

You can add the listener manually and pass the button itself in a delegate.
This is what I did for a keypad:

  private void Awake()
    {
        foreach (Button btn in GetComponentsInChildren<Button>())
        {
            btn.onClick.AddListener(delegate{ ButtonClicked(btn);  });
        }
    }
    private void ButtonClicked(Button btn)
    {
        string btnText = btn.gameObject.GetComponentInChildren<Text>().text;
        // ....
    }