diff --git a/surfsense_web/components/tool-ui/google-drive/create-file.tsx b/surfsense_web/components/tool-ui/google-drive/create-file.tsx index b56abf18b..d6f08653d 100644 --- a/surfsense_web/components/tool-ui/google-drive/create-file.tsx +++ b/surfsense_web/components/tool-ui/google-drive/create-file.tsx @@ -124,6 +124,11 @@ function ApprovalCard({ const [isEditing, setIsEditing] = useState(false); const [editedName, setEditedName] = useState(args.name ?? ""); const [editedContent, setEditedContent] = useState(args.content ?? ""); + const [committedArgs, setCommittedArgs] = useState<{ + name: string; + file_type: string; + content?: string | null; + } | null>(null); const accounts = interruptData.context?.accounts ?? []; @@ -248,29 +253,29 @@ function ApprovalCard({ )} - {/* Display mode */} - {!isEditing && ( -
+ {/* Display mode */} + {!isEditing && ( +
+
+

Name

+

{committedArgs?.name ?? args.name}

+
+
+

Type

+

+ {FILE_TYPE_LABELS[committedArgs?.file_type ?? args.file_type] ?? committedArgs?.file_type ?? args.file_type} +

+
+ {(committedArgs?.content ?? args.content) && (
-

Name

-

{args.name}

-
-
-

Type

-

- {FILE_TYPE_LABELS[args.file_type] ?? args.file_type} +

Content

+

+ {committedArgs?.content ?? args.content}

- {args.content && ( -
-

Content

-

- {args.content} -

-
- )} -
- )} + )} +
+ )} {/* Edit mode */} {isEditing && !decided && ( @@ -336,24 +341,26 @@ function ApprovalCard({

) : isEditing ? ( <> - + + )} {canEdit && (