File size: 945 Bytes
cb5b71d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import streamlit as st

from core.state import CurrentStep
from utils import jump_to


def render_side_buttons():
    with st.sidebar:

        def button_type(i: int) -> str:
            """Determines button color: red when user is on that given step."""
            return "primary" if st.session_state[CurrentStep] == i else "secondary"

        st.button(
            "Metadata",
            on_click=jump_to,
            args=[CurrentStep.editor],
            type=button_type("metadata"),
            use_container_width=True,
        )
        st.button(
            "Files",
            on_click=jump_to,
            args=[CurrentStep.editor],
            type=button_type("files"),
            use_container_width=True,
        )
        st.button(
            "RecordSets",
            on_click=jump_to,
            args=[CurrentStep.editor],
            type=button_type("recordsets"),
            use_container_width=True,
        )