
import streamlit.components.v1 as components
from pollination_streamlit.selectors import get_api_client
from pollination_streamlit_io import (create_study, study_progress)

from pollination_streamlit_viewer import viewer

import streamlit as st
import base64

api_client = get_api_client()

study_info = create_study('st-study', api_client)
if study_info:
    card_info = study_progress(api_client,
                                 study_info = study_info,
                                 show_output=True)
    if card_info:
        file = base64.b64decode(card_info['value'])
        name = card_info['name']
        if (name.endswith('vtkjs')):
            viewer(key='my-test', content=file)
        
