Loop products add to cart button custom text issue

Adding a custom text to the add to cart button like “Add” for example, when product is out of stock, the text remains the same. If you add an icon too, like a basket icon, you have a button with a basket icon and text “Add” for out of stock products.

It would be great to choose text for out of stock products, like you do for external product, variable product etc.

Until that, can anyone suggest to disable the add to cart button when product is out of stock?

Tried to hide it use it the function from here: Hide loop read more buttons for out of stock items Documentation - WooCommerce , but it breaks the layout with my custom loop.