jmontp's picture
Fix navigatin
4dc3a93
raw
history blame contribute delete
846 Bytes
"""Reusable navigation components for the Task Similarity Analysis app."""
import streamlit as st
NAV_ITEMS = [
{"label": "Documentation", "url": "/", "icon": "๐Ÿ“˜"},
{"label": "Tool", "url": "/Tool", "icon": "๐Ÿ› ๏ธ"},
]
def render_top_nav(active_label: str) -> None:
"""Render a horizontal navigation bar highlighting the current page."""
links = []
for item in NAV_ITEMS:
css_class = "nav-active" if item["label"] == active_label else "nav-link"
links.append(
f"<a class='{css_class}' href='{item['url']}' target='_self'>{item['icon']} {item['label']}</a>"
)
nav_html = """
<div class='top-nav-outer'>
<div class='top-nav-inner'>
{links}
</div>
</div>
""".format(links="".join(links))
st.markdown(nav_html, unsafe_allow_html=True)