From 560683d782fb8f993868cc845c2fa8c20ec996ad Mon Sep 17 00:00:00 2001 From: Lucas Oliveira Date: Fri, 5 Sep 2025 17:01:03 -0300 Subject: [PATCH] Added animation to displaying nudges --- frontend/src/app/chat/nudges.tsx | 51 ++++++++++++++++++++++---------- 1 file changed, 35 insertions(+), 16 deletions(-) diff --git a/frontend/src/app/chat/nudges.tsx b/frontend/src/app/chat/nudges.tsx index 0d713c89..c5929924 100644 --- a/frontend/src/app/chat/nudges.tsx +++ b/frontend/src/app/chat/nudges.tsx @@ -1,27 +1,46 @@ +import { motion, AnimatePresence } from "motion/react"; + export default function Nudges({ nudges, handleSuggestionClick, }: { nudges: string[]; + handleSuggestionClick: (suggestion: string) => void; }) { return ( -
-
-
- {nudges.map((suggestion: string, index: number) => ( - - ))} -
- {/* Fade out gradient on the right */} -
-
+
+ + {nudges.length > 0 && ( + +
+
+
+ {nudges.map((suggestion: string, index: number) => ( + + ))} +
+ {/* Fade out gradient on the right */} +
+
+
+
+ )} +
); }