mirror of
https://github.com/simstudioai/sim.git
synced 2026-01-10 23:48:09 -05:00
Added placeholders for long inputs and for agent and api
This commit is contained in:
@@ -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)}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -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}
|
||||
|
||||
@@ -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}>
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -26,6 +26,7 @@ export const ApiBlock: BlockConfig = {
|
||||
title: 'URL',
|
||||
type: 'short-input',
|
||||
layout: 'full',
|
||||
placeholder: 'Enter URL',
|
||||
},
|
||||
{
|
||||
title: 'Method',
|
||||
|
||||
Reference in New Issue
Block a user