wu981526092 commited on
Commit
eb6f30a
·
1 Parent(s): af6ace3

Fix TypeScript errors and add Input component for assistant saving

Browse files
frontend/src/components/ui/input.tsx ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import * as React from "react"
2
+
3
+ import { cn } from "@/lib/utils"
4
+
5
+ export interface InputProps
6
+ extends React.InputHTMLAttributes<HTMLInputElement> {}
7
+
8
+ const Input = React.forwardRef<HTMLInputElement, InputProps>(
9
+ ({ className, type, ...props }, ref) => {
10
+ return (
11
+ <input
12
+ type={type}
13
+ className={cn(
14
+ "flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
15
+ className
16
+ )}
17
+ ref={ref}
18
+ {...props}
19
+ />
20
+ )
21
+ }
22
+ )
23
+ Input.displayName = "Input"
24
+
25
+ export { Input }
frontend/src/pages/Playground.tsx CHANGED
@@ -856,7 +856,7 @@ export function Playground() {
856
  <Input
857
  id="assistant-name"
858
  value={assistantName}
859
- onChange={(e) => setAssistantName(e.target.value)}
860
  placeholder="e.g., Code Review Expert"
861
  className="mt-1"
862
  />
@@ -866,7 +866,7 @@ export function Playground() {
866
  <Textarea
867
  id="assistant-description"
868
  value={assistantDescription}
869
- onChange={(e) => setAssistantDescription(e.target.value)}
870
  placeholder="Describe what this assistant is good at..."
871
  rows={3}
872
  className="mt-1"
 
856
  <Input
857
  id="assistant-name"
858
  value={assistantName}
859
+ onChange={(e: React.ChangeEvent<HTMLInputElement>) => setAssistantName(e.target.value)}
860
  placeholder="e.g., Code Review Expert"
861
  className="mt-1"
862
  />
 
866
  <Textarea
867
  id="assistant-description"
868
  value={assistantDescription}
869
+ onChange={(e: React.ChangeEvent<HTMLTextAreaElement>) => setAssistantDescription(e.target.value)}
870
  placeholder="Describe what this assistant is good at..."
871
  rows={3}
872
  className="mt-1"