Ujeshhh commited on
Commit
27673d4
·
verified ·
1 Parent(s): 299af4d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +28 -2
app.py CHANGED
@@ -324,8 +324,33 @@ def schedule_appointment(therapist, time_slot, date, user_email, state):
324
  return (f"Appointment booked with {therapist} on {date} at {appointment_time}. "
325
  f"Email sending failed: {error_msg}. Please contact {therapist_email}."), state
326
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
327
  # Gradio Interface
328
- with gr.Blocks(title="Mental Health Support Chatbot") as demo:
329
  state = gr.State({"chat_history": [], "mood_journal": [], "feedback": [], "appointments": [], "failed_emails": []})
330
 
331
  gr.Markdown("## Mental Health Support Chatbot")
@@ -387,7 +412,8 @@ with gr.Blocks(title="Mental Health Support Chatbot") as demo:
387
  )
388
  date = gr.Textbox(
389
  label="Appointment Date",
390
- placeholder="Enter date (YYYY-MM-DD)"
 
391
  )
392
  time_slot = gr.Dropdown(
393
  choices=["Select time"],
 
324
  return (f"Appointment booked with {therapist} on {date} at {appointment_time}. "
325
  f"Email sending failed: {error_msg}. Please contact {therapist_email}."), state
326
 
327
+ # Minimal CSS for date picker alignment
328
+ custom_css = """
329
+ #date-picker input[type="date"] {
330
+ width: 100%;
331
+ padding: 8px;
332
+ border: 1px solid #ccc;
333
+ border-radius: 4px;
334
+ font-size: 16px;
335
+ }
336
+ #date-picker input[type="date"]::-webkit-calendar-picker-indicator {
337
+ cursor: pointer;
338
+ }
339
+ """
340
+
341
+ # JavaScript for date picker
342
+ custom_js = """
343
+ document.addEventListener('DOMContentLoaded', function() {
344
+ const dateInput = document.querySelector('#date-picker input');
345
+ if (dateInput) {
346
+ dateInput.type = 'date';
347
+ dateInput.placeholder = 'YYYY-MM-DD';
348
+ }
349
+ });
350
+ """
351
+
352
  # Gradio Interface
353
+ with gr.Blocks(title="Mental Health Support Chatbot", css=custom_css, js=custom_js) as demo:
354
  state = gr.State({"chat_history": [], "mood_journal": [], "feedback": [], "appointments": [], "failed_emails": []})
355
 
356
  gr.Markdown("## Mental Health Support Chatbot")
 
412
  )
413
  date = gr.Textbox(
414
  label="Appointment Date",
415
+ placeholder="Select date (YYYY-MM-DD)",
416
+ elem_id="date-picker"
417
  )
418
  time_slot = gr.Dropdown(
419
  choices=["Select time"],