2025-07-21 11:06:02 +03:00
|
|
|
import { TextArea } from '@/components/input';
|
|
|
|
|
|
2025-07-22 20:38:08 +03:00
|
|
|
import { PromptInput } from '../../components/prompt-input';
|
|
|
|
|
import { useAvailableVariables } from '../../stores/use-available-variables';
|
|
|
|
|
|
2025-07-21 11:06:02 +03:00
|
|
|
interface TabPromptEditProps {
|
|
|
|
|
label: string;
|
|
|
|
|
description: string;
|
|
|
|
|
text: string;
|
|
|
|
|
setText: (value: string) => void;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function TabPromptEdit({ label, description, text, setText }: TabPromptEditProps) {
|
2025-07-22 20:38:08 +03:00
|
|
|
const availableVariables = useAvailableVariables();
|
2025-07-21 11:06:02 +03:00
|
|
|
return (
|
|
|
|
|
<div className='cc-column'>
|
|
|
|
|
<div className='flex flex-col gap-2'>
|
|
|
|
|
<TextArea
|
|
|
|
|
id='prompt-label'
|
|
|
|
|
label='Название' //
|
|
|
|
|
value={label}
|
|
|
|
|
disabled
|
|
|
|
|
noResize
|
|
|
|
|
rows={1}
|
|
|
|
|
/>
|
|
|
|
|
<TextArea id='prompt-description' label='Описание' value={description} disabled noResize rows={3} />
|
2025-07-22 20:38:08 +03:00
|
|
|
<PromptInput
|
2025-07-21 11:06:02 +03:00
|
|
|
id='prompt-text' //
|
|
|
|
|
label='Текст шаблона'
|
|
|
|
|
value={text}
|
2025-07-22 20:38:08 +03:00
|
|
|
onChange={setText}
|
|
|
|
|
maxHeight='10rem'
|
|
|
|
|
availableVariables={availableVariables}
|
2025-07-21 11:06:02 +03:00
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|