From 840be3f0e5adc77b811c41c902330eb865adb2d6 Mon Sep 17 00:00:00 2001 From: Lucas Vas Date: Tue, 3 Mar 2026 09:44:55 -0500 Subject: [PATCH] feat: implement checking for file types --- src/components/file_drop.rs | 67 ++++++++++++++++++++++++----- src/pages/student/financial_page.rs | 7 ++- 2 files changed, 62 insertions(+), 12 deletions(-) diff --git a/src/components/file_drop.rs b/src/components/file_drop.rs index 8580442..e83092f 100644 --- a/src/components/file_drop.rs +++ b/src/components/file_drop.rs @@ -9,9 +9,19 @@ use leptos_use::{UseDropZoneOptions, UseDropZoneReturn, use_drop_zone_with_optio #[component] pub fn FileDrop( - #[prop(into)] name: String, - #[prop(into)] form_id: String, - #[prop()] existing_files: Resource, ServerFnError>>, + /// The name of this input. Used in file organization. + #[prop(into)] + name: String, + /// The ID of the form containing this input. Used in file organization. + #[prop(into)] + form_id: String, + /// The types that a file is allowed to be. Must be specified as the desired file extension (i.e. + /// `.pdf`, `.txt`, etc.) + #[prop(optional)] + allowed_types: Vec, + /// A [`Resource`] that gives the currently uploaded files for this input. + #[prop()] + existing_files: Resource, ServerFnError>>, ) -> impl IntoView { let zone_ref = NodeRef::