Added placeholders for long inputs and for agent and api

This commit is contained in:
Emir Karabeg
2025-01-15 14:39:05 -08:00
parent fac078dea1
commit 000a58e833
5 changed files with 22 additions and 4 deletions

View File

@@ -1,5 +1,20 @@
import { Textarea } from '@/components/ui/textarea'
import { useState } from 'react'
export function LongInput() {
return <Textarea className="w-full resize-none" rows={3} />
interface LongInputProps {
placeholder?: string
}
export function LongInput({ placeholder }: LongInputProps) {
const [value, setValue] = useState('')
return (
<Textarea
className="w-full resize-none placeholder:text-muted-foreground/50"
rows={3}
placeholder={placeholder ?? ''}
value={value}
onChange={(e) => setValue(e.target.value)}
/>
)
}

View File

@@ -12,7 +12,7 @@ export function ShortInput({ placeholder, password }: ShortInputProps) {
return (
<Input
className="w-full"
className="w-full placeholder:text-muted-foreground/50"
placeholder={placeholder ?? ''}
type={password && !isFocused ? 'password' : 'text'}
value={value}

View File

@@ -26,7 +26,7 @@ export function SubBlock({ config }: SubBlockProps) {
/>
)
case 'long-input':
return <LongInput />
return <LongInput placeholder={config.placeholder} />
case 'dropdown':
return (
<div onMouseDown={handleMouseDown}>

View File

@@ -24,11 +24,13 @@ export const AgentBlock: BlockConfig = {
title: 'System Prompt',
type: 'long-input',
layout: 'full',
placeholder: 'Enter prompt',
},
{
title: 'Context',
type: 'short-input',
layout: 'full',
placeholder: 'Enter text',
},
{
title: 'Model',

View File

@@ -26,6 +26,7 @@ export const ApiBlock: BlockConfig = {
title: 'URL',
type: 'short-input',
layout: 'full',
placeholder: 'Enter URL',
},
{
title: 'Method',