Refactor: extract `tab` and `footer` templates

Share a `tab` and `footer` template between tabs and focused fragment.