import streamlit as st # Function to simulate sending an email def send_email(tool, email): # Here you can add your email sending logic # For now, we'll just print the details to the console st.write(f"Tool: {tool}") st.write(f"Email: {email}") st.success("Your request has been sent successfully!") # Store the tool and email in session state st.session_state['tool'] = tool st.session_state['email'] = email st.session_state['page'] = 'mail' # Function for the tool request form page def tool_request_page(): st.title("Tool Request Form") # Input fields tool = st.text_input("Tool Name", placeholder="Enter the tool you need") email = st.text_input("Your Email", placeholder="Enter your email address") # Send button if st.button("Send"): if tool and email: send_email(tool, email) else: st.error("Please fill in both the tool name and your email address.") # Function for the email confirmation page def mail_page(): st.title("Email Sent Successfully") st.write("Thank you for your tool request! Your email has been sent.") st.write("Here are the details of your request:") # Retrieve the tool and email from session state tool = st.session_state.get('tool') email = st.session_state.get('email') if tool and email: st.write(f"**Tool:** {tool}") st.write(f"**Email:** {email}") else: st.write("No request details found.") # Main function to handle page navigation def main(): if 'page' not in st.session_state: st.session_state['page'] = 'tool_request' if st.session_state['page'] == 'tool_request': tool_request_page() elif st.session_state['page'] == 'mail': mail_page() if __name__ == "__main__": main()