From 0bcfbcb5864c580caadd8729a309c90e2f65eb88 Mon Sep 17 00:00:00 2001 From: Pengoose Date: Thu, 26 Sep 2024 16:30:45 +0900 Subject: [PATCH 1/2] refactor: simplify ChatInput by extending TextareaHTMLAttributes --- apps/docs/components/ui/chat/chat-input.tsx | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/apps/docs/components/ui/chat/chat-input.tsx b/apps/docs/components/ui/chat/chat-input.tsx index 953e3ec..475efe6 100644 --- a/apps/docs/components/ui/chat/chat-input.tsx +++ b/apps/docs/components/ui/chat/chat-input.tsx @@ -2,24 +2,14 @@ import * as React from "react"; import { Textarea } from "@/components/ui/textarea"; import { cn } from "@/lib/utils"; -interface ChatInputProps { - className?: string; - value?: string; - onKeyDown?: (event: React.KeyboardEvent) => void; - onChange?: (event: React.ChangeEvent) => void; - placeholder?: string; -} +interface ChatInputProps extends React.TextareaHTMLAttributes{} const ChatInput = React.forwardRef( - ({ className, value, onKeyDown, onChange, placeholder, ...props }, ref) => ( + ({ className, ...props }, ref) => (