File size: 1,418 Bytes
635bc3d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
36
37
38
39
40
41
import streamlit as st
import pandas as pd
from datetime import datetime

def feedback():
    st.title("Feedback")
    st.write("We value your feedback to help us improve PawSome-AI!")

    # Feedback form
    with st.form(key='feedback_form'):
        name = st.text_input("Your Name")
        email = st.text_input("Your Email")
        feedback_type = st.selectbox("Type of Feedback", ["Suggestion", "Issue", "Other"])
        message = st.text_area("Your Feedback")
        submit_button = st.form_submit_button(label="Submit")

    # After the user clicks the submit button
    if submit_button:
        feedback_data = {
            "name": [name],
            "email": [email],
            "feedback_type": [feedback_type],
            "message": [message],
            "timestamp": [datetime.now()]
        }
        feedback_df = pd.DataFrame(feedback_data)

        # Save the feedback to a CSV file
        try:
            existing_feedback_df = pd.read_csv("feedback.csv")
            feedback_df = pd.concat([existing_feedback_df, feedback_df], ignore_index=True)
        except FileNotFoundError:
            pass

        feedback_df.to_csv("feedback.csv", index=False)

        st.success("Thank you for your feedback! We'll get back to you shortly.")

    st.write("If you need immediate assistance, please contact us at: ")
    st.markdown("[support@pawsome-ai.com](mailto:support@pawsome-ai.com)")