File size: 599 Bytes
4e00df7
 
 
 
 
8a70a7b
2329c69
4e00df7
 
d536adc
4e00df7
d536adc
 
2329c69
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import streamlit as st


def view_document(supabase):
    # Get the document from the database
    response = supabase.table("documents").select("content").filter('metadata->>user', 'eq', st.session_state["username"]).execute()
    # st.write("**This feature is in active development**")
    # Display a list of elements from the documents
    # If the user clicks on an element, display the content of the document
    i = 0
    for document in response.data:
        i += 1
        if st.button(document['content'][:50].replace("\n", " "), key = str(i)):
            st.write(document['content'])