From a97f025ed0ad552b2530bf945975c908aa22652a Mon Sep 17 00:00:00 2001 From: donghaxkim Date: Sat, 7 Feb 2026 23:47:56 -0500 Subject: [PATCH] comments added to suggested questions, dropdown-menu, input --- components/suggested-questions.tsx | 14 +++++++++++++- components/ui/dropdown-menu.tsx | 8 ++++++++ components/ui/input.tsx | 4 ++++ 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/components/suggested-questions.tsx b/components/suggested-questions.tsx index 807955ee..3e9582fb 100644 --- a/components/suggested-questions.tsx +++ b/components/suggested-questions.tsx @@ -1,13 +1,25 @@ "use client"; import { Button } from "@/components/ui/button"; + +/** + * Properties for the SuggestedQuestions component. + */ interface SuggestedQuestionsProps { + /** The list of strings to be displayed as clickable suggestion buttons. */ questions: string[]; + /** Callback function executed when a suggestion is clicked. Passes the text and index. */ onQuestionClick: (question: string, index: number) => void; + /** Optional: Indicates if data is currently being fetched. */ isLoading?: boolean; + /** Optional: If true, disables buttons to prevent multiple clicks during an active chat. */ isChatLoading?: boolean; } +/** + * Renders a list of suggested prompts for the user to interact with. + * Designed to appear at the end of a chat sequence. + */ export function SuggestedQuestions({ questions, onQuestionClick, @@ -35,4 +47,4 @@ export function SuggestedQuestions({ })} ); -} +} \ No newline at end of file diff --git a/components/ui/dropdown-menu.tsx b/components/ui/dropdown-menu.tsx index 47b9f9b3..225a4470 100644 --- a/components/ui/dropdown-menu.tsx +++ b/components/ui/dropdown-menu.tsx @@ -6,12 +6,20 @@ import { CheckIcon, ChevronRightIcon, CircleIcon } from "lucide-react" import { cn } from "@/lib/utils" +/** + * Root component for the dropdown menu. + * Provides the context and state for all other dropdown components. + */ function DropdownMenu({ ...props }: React.ComponentProps) { return } +/** + * Portals the dropdown content into a different part of the DOM tree. + * Useful for escaping overflow-hidden containers. + */ function DropdownMenuPortal({ ...props }: React.ComponentProps) { diff --git a/components/ui/input.tsx b/components/ui/input.tsx index da8df7fc..29a5e929 100644 --- a/components/ui/input.tsx +++ b/components/ui/input.tsx @@ -1,5 +1,9 @@ import * as React from "react" +/** + * input component + */ + import { cn } from "@/lib/utils" function Input({ className, type, ...props }: React.ComponentProps<"input">) {