Spaces:
Runtime error
Runtime error
| """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) | |