Enable/disable resource in terraform using count
I believe you should be able to reference the namespace name like so:
namespace_name      = azurerm_eventhub_namespace.eventhub[0].name
However, if the namespace_name field is a required parameter on the resources you are passing it to, you might run into other issues while you are trying to set enabled to false, as the resources depend on the output of the resource you are setting to count[0]. If you want them all to be conditional on the creation of the namespace, i would recommend continuing down your approach with the for_each over the local values.
If you need to the other resources to not be created unless the namespace is created you can create a condition on your local value like this (assuming map):
locals{
    hub = var.enable_eh ? {foo = &quot;bar&quot;, baz = &quot;qux&quot;} : {}
}

The for_each will omit the resources that are empty.