-
Notifications
You must be signed in to change notification settings - Fork 798
Expand file tree
/
Copy pathChatInputArea.tsx
More file actions
674 lines (633 loc) · 25.6 KB
/
Copy pathChatInputArea.tsx
File metadata and controls
674 lines (633 loc) · 25.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
import { useState, useEffect, useLayoutEffect, useRef, forwardRef, useImperativeHandle, KeyboardEvent, Ref } from 'react'
import {
Button,
Caption1,
Tooltip,
Text,
tokens,
mergeClasses,
} from '@fluentui/react-components'
import { SendRegular, AttachRegular, DismissRegular, InfoRegular, AddRegular, CopyRegular, WarningRegular, SettingsRegular, ArrowShuffleRegular, OpenRegular } from '@fluentui/react-icons'
import { MessageAttachment, TargetInstance } from '../../types'
import { useChatInputAreaStyles } from './ChatInputArea.styles'
import SystemPromptSetup from './SystemPromptSetup'
import { PIECE_TYPE_TO_DATA_TYPE } from './converterTypes'
// ---------------------------------------------------------------------------
// Reusable status banner
// ---------------------------------------------------------------------------
export interface ConvertedFileChip {
name: string
url: string
iconKind: 'image' | 'audio' | 'video' | 'file'
}
interface StatusBannerProps {
icon: React.ReactElement
text: string
buttonText?: string
buttonIcon?: React.ReactElement
onButtonClick?: () => void
testId: string
className: string
textClassName: string
buttonTestId?: string
}
function StatusBanner({ icon, text, buttonText, buttonIcon, onButtonClick, testId, className, textClassName, buttonTestId }: StatusBannerProps) {
return (
<div className={className} data-testid={testId}>
{icon}
<Text className={textClassName} size={300}>
{text}
</Text>
{onButtonClick && buttonText && (
<Button
appearance="primary"
icon={buttonIcon}
onClick={onButtonClick}
data-testid={buttonTestId}
>
{buttonText}
</Button>
)}
</div>
)
}
// ---------------------------------------------------------------------------
// Attachment list
// ---------------------------------------------------------------------------
interface AttachmentListProps {
attachments: MessageAttachment[]
mediaConversions: Array<{ pieceType: string; convertedValue: string; convertedDataType: string }>
onRemove: (index: number) => void
onClearMediaConversion: (pieceType: string) => void
formatFileSize: (bytes: number) => string
styles: ReturnType<typeof useChatInputAreaStyles>
}
function AttachmentList({ attachments, mediaConversions, onRemove, onClearMediaConversion, formatFileSize, styles }: AttachmentListProps) {
if (attachments.length === 0) return null
return (
<div className={styles.attachmentsContainer}>
{attachments.map((att, index) => {
const conversion = mediaConversions.find((mc) => mc.pieceType === att.type)
return (
<div key={index} className={styles.attachmentGroup}>
<div className={styles.attachmentRow}>
<span className={styles.attachmentContent}>
{conversion && <span className={styles.originalBadge}>Original</span>}
<Caption1>
{att.type === 'image' && '🖼️'}
{att.type === 'audio' && '🎵'}
{att.type === 'video' && '🎥'}
{att.type === 'file' && '📄'}
{' '}{att.name}{att.size != null ? ` (${formatFileSize(att.size)})` : ''}
</Caption1>
</span>
<Button
appearance="transparent"
size="small"
className={styles.dismissBtn}
icon={<DismissRegular />}
onClick={() => onRemove(index)}
data-testid={`remove-attachment-${index}`}
/>
</div>
{conversion && (
<div className={styles.attachmentRow}>
<span className={styles.attachmentContent}>
<span className={styles.convertedBadge}>Converted</span>
<Caption1 className={styles.convertedFilename}>{conversion.convertedValue.split('/').pop()}</Caption1>
</span>
<Button
appearance="transparent"
size="small"
className={styles.dismissBtn}
icon={<DismissRegular />}
onClick={() => onClearMediaConversion(att.type)}
data-testid={`clear-media-conversion-${att.type}`}
/>
</div>
)}
</div>
)
})}
</div>
)
}
// ---------------------------------------------------------------------------
// Text input rows (original + converted)
// ---------------------------------------------------------------------------
interface TextInputRowsProps {
input: string
convertedValue?: string | null
convertedFileChip?: ConvertedFileChip | null
disabled: boolean
textareaRef: Ref<HTMLTextAreaElement>
convertedRef: Ref<HTMLTextAreaElement>
onInput: (e: React.ChangeEvent<HTMLTextAreaElement>) => void
onKeyDown: (e: KeyboardEvent<HTMLTextAreaElement>) => void
onConvertedValueChange: (value: string) => void
onClearConvertedFileChip?: () => void
styles: ReturnType<typeof useChatInputAreaStyles>
textInputClassName: string
}
function TextInputRows({ input, convertedValue, convertedFileChip, disabled, textareaRef, convertedRef, onInput, onKeyDown, onConvertedValueChange, onClearConvertedFileChip, styles, textInputClassName }: TextInputRowsProps) {
const hasConversion = Boolean(convertedValue) || Boolean(convertedFileChip)
return (
<>
<div className={styles.textRow}>
{hasConversion && (
<span className={styles.originalBadge} data-testid="original-banner">Original</span>
)}
<textarea
ref={textareaRef}
className={textInputClassName}
placeholder="Type prompt here"
value={input}
onChange={onInput}
onKeyDown={onKeyDown}
disabled={disabled}
rows={1}
data-testid="chat-input"
/>
</div>
{convertedValue && (
<div className={styles.convertedRow} data-testid="converted-indicator">
<span className={styles.convertedBadge}>Converted</span>
<textarea
ref={convertedRef}
className={styles.convertedTextarea}
value={convertedValue}
onChange={(e) => onConvertedValueChange(e.target.value)}
rows={1}
data-testid="converted-value-input"
/>
</div>
)}
{!convertedValue && convertedFileChip && (
<div className={styles.convertedFileBlock} data-testid="converted-file-chip">
<div className={styles.convertedRow}>
<span className={styles.convertedBadge}>Converted</span>
<span aria-hidden="true">
{convertedFileChip.iconKind === 'image' && '🖼️'}
{convertedFileChip.iconKind === 'audio' && '🎵'}
{convertedFileChip.iconKind === 'video' && '🎥'}
{convertedFileChip.iconKind === 'file' && '📄'}
</span>
<Caption1 className={styles.convertedFilename} title={convertedFileChip.name}>
{convertedFileChip.name}
</Caption1>
<Tooltip content="Open in new tab" relationship="label">
<a
href={convertedFileChip.url}
target="_blank"
rel="noopener noreferrer"
className={styles.openLink}
data-testid="converted-file-open"
>
<OpenRegular fontSize={14} />
<span>Open</span>
</a>
</Tooltip>
<Button
appearance="transparent"
size="small"
className={styles.dismissBtn}
icon={<DismissRegular />}
onClick={onClearConvertedFileChip}
data-testid="clear-converted-file-chip"
/>
</div>
{convertedFileChip.iconKind === 'image' && (
<img
src={convertedFileChip.url}
alt={convertedFileChip.name}
className={styles.convertedImagePreview}
data-testid="converted-file-preview-image"
/>
)}
{convertedFileChip.iconKind === 'audio' && (
<audio
controls
src={convertedFileChip.url}
className={styles.convertedAudioPreview}
data-testid="converted-file-preview-audio"
/>
)}
{convertedFileChip.iconKind === 'video' && (
<video
controls
src={convertedFileChip.url}
className={styles.convertedVideoPreview}
data-testid="converted-file-preview-video"
/>
)}
</div>
)}
</>
)
}
// ---------------------------------------------------------------------------
// Target modality validation
// ---------------------------------------------------------------------------
/**
* Returns the attachment UI types (e.g. `'image'`, `'audio'`, `'file'`) whose
* underlying `PromptDataType` the active target does not accept.
*
* Returns an empty list if no target is selected, if the target advertises no
* capabilities, or if every attachment is supported. Deduplicated by UI type.
*/
function getUnsupportedAttachmentTypes(
attachments: MessageAttachment[],
activeTarget: TargetInstance | null | undefined,
): string[] {
if (!activeTarget?.capabilities?.supported_input_modalities) return []
const supported = new Set(activeTarget.capabilities.supported_input_modalities)
const unsupported: string[] = []
const seen = new Set<string>()
for (const att of attachments) {
const dataType = PIECE_TYPE_TO_DATA_TYPE[att.type]
if (dataType && !seen.has(att.type) && !supported.has(dataType)) {
seen.add(att.type)
unsupported.push(att.type)
}
}
return unsupported
}
/**
* Returns the converter output `PromptDataType` strings (e.g. `'image_path'`)
* the active target does not accept. Surfaced separately from attachment
* checks because converters can produce data types that don't match any
* existing attachment (e.g. a text-to-image converter on text input).
*
* Returns an empty list if no target is selected, if the target advertises no
* capabilities, or if every converter output is supported.
*/
function getUnsupportedConverterOutputTypes(
converterOutputDataTypes: string[],
activeTarget: TargetInstance | null | undefined,
): string[] {
if (!activeTarget?.capabilities?.supported_input_modalities) return []
const supported = new Set(activeTarget.capabilities.supported_input_modalities)
const unsupported: string[] = []
const seen = new Set<string>()
for (const dataType of converterOutputDataTypes) {
if (!seen.has(dataType) && !supported.has(dataType)) {
seen.add(dataType)
unsupported.push(dataType)
}
}
return unsupported
}
// Strip the `_path` suffix used internally for media `PromptDataType` strings
// so the UI shows e.g. "image" instead of "image_path", matching ConverterPanel badges.
const formatModalityLabel = (modality: string): string => modality.replace('_path', '')
// ---------------------------------------------------------------------------
// Main component
// ---------------------------------------------------------------------------
export interface ChatInputAreaHandle {
addAttachment: (att: MessageAttachment) => void
setText: (text: string) => void
}
interface ChatInputAreaProps {
onSend: (originalValue: string, convertedValue: string | undefined, attachments: MessageAttachment[]) => void
disabled?: boolean
activeTarget?: TargetInstance | null
singleTurnLimitReached?: boolean
onNewConversation: () => void
operatorLocked?: boolean
crossTargetLocked?: boolean
onUseAsTemplate: () => void
attackOperator?: string
noTargetSelected?: boolean
onConfigureTarget: () => void
onToggleConverterPanel: () => void
isConverterPanelOpen: boolean
onInputChange: (value: string) => void
onAttachmentsChange: (types: string[], data: Record<string, string>) => void
convertedValue?: string | null
originalValue?: string | null
onClearConversion: () => void
onConvertedValueChange: (value: string) => void
converterOutputDataTypes?: string[]
mediaConversions?: Array<{ pieceType: string; convertedValue: string; convertedDataType: string }>
onClearMediaConversion: (pieceType: string) => void
/** Chip describing a text→file conversion (e.g. PDFConverter output). */
convertedFileChip?: ConvertedFileChip | null
onClearConvertedFileChip?: () => void
/** Whether to show the system-prompt setup (only for a brand-new conversation). */
showSystemPrompt?: boolean
/** Whether the active target supports system prompts (gates the setup's enabled state). */
supportsSystemPrompt?: boolean
systemPrompt?: string
onSystemPromptChange?: (value: string) => void
}
const ChatInputArea = forwardRef<ChatInputAreaHandle, ChatInputAreaProps>(function ChatInputArea({ onSend, disabled = false, activeTarget, singleTurnLimitReached = false, onNewConversation, operatorLocked = false, crossTargetLocked = false, onUseAsTemplate, attackOperator, noTargetSelected = false, onConfigureTarget, onToggleConverterPanel, isConverterPanelOpen = false, onInputChange, onAttachmentsChange, convertedValue, originalValue: _originalValue, onClearConversion, onConvertedValueChange, converterOutputDataTypes = [], mediaConversions = [], onClearMediaConversion, convertedFileChip, onClearConvertedFileChip, showSystemPrompt = false, supportsSystemPrompt = false, systemPrompt = '', onSystemPromptChange }, ref) {
const styles = useChatInputAreaStyles()
const [input, setInput] = useState('')
const [attachments, setAttachments] = useState<MessageAttachment[]>([])
const fileInputRef = useRef<HTMLInputElement>(null)
const textareaRef = useRef<HTMLTextAreaElement>(null)
const convertedRef = useRef<HTMLTextAreaElement>(null)
// Derive unsupported types from attachments AND converter outputs
const unsupportedAttachmentTypes = getUnsupportedAttachmentTypes(attachments, activeTarget)
const unsupportedConverterOutputTypes = getUnsupportedConverterOutputTypes(converterOutputDataTypes, activeTarget)
const hasUnsupportedModalities =
unsupportedAttachmentTypes.length > 0 || unsupportedConverterOutputTypes.length > 0
const hasConversion = convertedValue != null && convertedValue !== ''
const textInputClassName = hasConversion
? mergeClasses(styles.textInput, styles.textInputShared)
: styles.textInput
useImperativeHandle(ref, () => ({
addAttachment: (att: MessageAttachment) => {
setAttachments(prev => [...prev, att])
},
setText: (text: string) => {
setInput(text)
},
}))
const handleFileSelect = async (e: React.ChangeEvent<HTMLInputElement>) => {
const files = e.target.files
if (!files) return
const newAttachments: MessageAttachment[] = []
for (let i = 0; i < files.length; i++) {
const file = files[i]
const url = URL.createObjectURL(file)
let type: MessageAttachment['type'] = 'file'
if (file.type.startsWith('image/')) type = 'image'
else if (file.type.startsWith('audio/')) type = 'audio'
else if (file.type.startsWith('video/')) type = 'video'
newAttachments.push({
type,
name: file.name,
url,
mimeType: file.type,
size: file.size,
file,
})
}
setAttachments([...attachments, ...newAttachments])
if (fileInputRef.current) {
fileInputRef.current.value = ''
}
}
const removeAttachment = (index: number) => {
const newAttachments = [...attachments]
URL.revokeObjectURL(newAttachments[index].url)
newAttachments.splice(index, 1)
setAttachments(newAttachments)
}
const handleSend = () => {
if ((input || attachments.length > 0) && !disabled && !hasUnsupportedModalities) {
onSend(input, convertedValue ?? undefined, attachments)
setInput('')
setAttachments([])
onClearConversion()
if (textareaRef.current) {
textareaRef.current.style.height = 'auto'
}
}
}
// Re-focus the textarea after sending completes (disabled goes false)
useEffect(() => {
if (!disabled && textareaRef.current) {
textareaRef.current.focus()
}
}, [disabled])
const handleKeyDown = (e: KeyboardEvent<HTMLTextAreaElement>) => {
if (e.key === 'Enter' && !e.shiftKey) {
e.preventDefault()
handleSend()
}
}
// Auto-resize textareas whenever content changes.
// useLayoutEffect fires before paint, avoiding visible flicker on resize.
// CSS max-height (60vh solo / 30vh shared) caps the growth; overflowY: auto scrolls beyond.
useLayoutEffect(() => {
if (textareaRef.current) {
textareaRef.current.style.height = 'auto'
textareaRef.current.style.height = textareaRef.current.scrollHeight + 'px'
}
onInputChange(input)
}, [input, onInputChange])
useLayoutEffect(() => {
if (convertedRef.current) {
convertedRef.current.style.height = 'auto'
convertedRef.current.style.height = convertedRef.current.scrollHeight + 'px'
}
}, [convertedValue])
useEffect(() => {
const types = [...new Set(attachments.map((a) => a.type))]
// Convert the first attachment per media type to a base64 data URI for the
// converter panel. Only one attachment per type is supported because the
// converter panel operates on a single value per piece type.
let cancelled = false
const buildData = async () => {
const data: Record<string, string> = {}
for (const att of attachments) {
if (cancelled) return
if (!data[att.type] && att.file) {
const reader = new FileReader()
const base64 = await new Promise<string>((resolve, reject) => {
reader.onload = () => resolve(reader.result as string)
reader.onerror = () => reject(reader.error)
reader.readAsDataURL(att.file!)
})
if (cancelled) return
data[att.type] = base64
}
}
if (!cancelled) {
onAttachmentsChange(types, data)
}
}
void buildData()
return () => { cancelled = true }
}, [attachments, onAttachmentsChange])
const handleInput = (e: React.ChangeEvent<HTMLTextAreaElement>) => {
setInput(e.target.value)
}
const formatFileSize = (bytes: number) => {
if (bytes < 1024) return bytes + ' B'
if (bytes < 1024 * 1024) return (bytes / 1024).toFixed(1) + ' KB'
return (bytes / (1024 * 1024)).toFixed(1) + ' MB'
}
return (
<div className={styles.root}>
<div className={styles.inputContainer}>
{noTargetSelected ? (
<StatusBanner
className={styles.noTargetBanner}
textClassName={styles.noTargetText}
icon={<WarningRegular fontSize={18} style={{ color: tokens.colorPaletteRedForeground1 }} />}
text="No target selected"
buttonText="Configure Target"
buttonIcon={<SettingsRegular />}
onButtonClick={onConfigureTarget}
testId="no-target-banner"
buttonTestId="configure-target-input-btn"
/>
) : operatorLocked ? (
<StatusBanner
className={styles.statusBanner}
textClassName={styles.statusBannerText}
icon={<InfoRegular fontSize={18} />}
text={`This conversation belongs to operator: ${attackOperator}.`}
buttonText="Continue with your target"
buttonIcon={<CopyRegular />}
onButtonClick={onUseAsTemplate}
testId="operator-locked-banner"
buttonTestId="use-as-template-btn"
/>
) : crossTargetLocked ? (
<StatusBanner
className={styles.statusBanner}
textClassName={styles.statusBannerText}
icon={<InfoRegular fontSize={18} />}
text="This attack uses a different target. Continue with your target to keep the conversation."
buttonText="Continue with your target"
buttonIcon={<CopyRegular />}
onButtonClick={onUseAsTemplate}
testId="cross-target-banner"
buttonTestId="use-as-template-btn"
/>
) : singleTurnLimitReached ? (
<StatusBanner
className={styles.statusBanner}
textClassName={styles.statusBannerText}
icon={<InfoRegular fontSize={18} />}
text="This target only supports single-turn conversations."
buttonText="New Conversation"
buttonIcon={<AddRegular />}
onButtonClick={onNewConversation}
testId="single-turn-banner"
buttonTestId="new-conversation-btn"
/>
) : (
<>
<div className={styles.inputWrapper}>
{showSystemPrompt && onSystemPromptChange && (
<SystemPromptSetup
value={systemPrompt}
onChange={onSystemPromptChange}
disabled={!!activeTarget && !supportsSystemPrompt}
/>
)}
<input
ref={fileInputRef}
type="file"
multiple
accept="image/*,audio/*,video/*,.pdf,.doc,.docx,.txt"
style={{ display: 'none' }}
onChange={handleFileSelect}
/>
<div className={styles.inputColumns}>
<div className={styles.columnLeft}>
<Tooltip content="Attach files" relationship="label">
<Button
className={styles.iconButton}
appearance="subtle"
icon={<AttachRegular />}
onClick={() => fileInputRef.current?.click()}
disabled={disabled}
aria-label="Attach files"
/>
</Tooltip>
<Tooltip content="Toggle converter panel" relationship="label">
<Button
className={styles.iconButton}
appearance={isConverterPanelOpen ? 'primary' : 'subtle'}
icon={<ArrowShuffleRegular />}
onClick={onToggleConverterPanel}
disabled={disabled}
data-testid="toggle-converter-panel-btn"
aria-label="Toggle converter panel"
/>
</Tooltip>
</div>
<div className={styles.columnCenter}>
<AttachmentList
attachments={attachments}
mediaConversions={mediaConversions}
onRemove={removeAttachment}
onClearMediaConversion={onClearMediaConversion}
formatFileSize={formatFileSize}
styles={styles}
/>
{hasUnsupportedModalities && (
<div className={styles.unsupportedWarning} data-testid="unsupported-modality-warning">
<WarningRegular fontSize={14} />
<Caption1>
{unsupportedAttachmentTypes.length > 0 && (
<>
This target does not support {unsupportedAttachmentTypes.join(', ')} attachments.
Remove them to send.
</>
)}
{unsupportedAttachmentTypes.length > 0 && unsupportedConverterOutputTypes.length > 0 && ' '}
{unsupportedConverterOutputTypes.length > 0 && (
<>
The selected converter produces{' '}
{unsupportedConverterOutputTypes.map(formatModalityLabel).join(', ')} output, which this target
does not support.
</>
)}
</Caption1>
</div>
)}
<TextInputRows
input={input}
convertedValue={convertedValue}
convertedFileChip={convertedFileChip}
disabled={disabled}
textareaRef={textareaRef}
convertedRef={convertedRef}
onInput={handleInput}
onKeyDown={handleKeyDown}
onConvertedValueChange={onConvertedValueChange}
onClearConvertedFileChip={onClearConvertedFileChip}
styles={styles}
textInputClassName={textInputClassName}
/>
</div>
<div className={styles.columnRight}>
{activeTarget && activeTarget.capabilities?.supports_multi_turn === false && (
<Tooltip
content="This target does not track conversation history — each turn is sent independently."
relationship="description"
>
<span className={styles.singleTurnWarning}>
<InfoRegular fontSize={18} />
</span>
</Tooltip>
)}
<Tooltip content="Send message" relationship="label">
<Button
className={styles.sendButton}
appearance="primary"
icon={<SendRegular />}
onClick={handleSend}
disabled={disabled || (!input && attachments.length === 0) || hasUnsupportedModalities}
aria-label="Send message"
data-testid="send-message-btn"
/>
</Tooltip>
{convertedValue && (
<Tooltip content="Clear conversion" relationship="label">
<Button
appearance="subtle"
className={styles.clearConversionButton}
icon={<DismissRegular />}
onClick={onClearConversion}
data-testid="clear-conversion-btn"
/>
</Tooltip>
)}
</div>
</div>
</div>
</>
)}
</div>
</div>
)
})
export default ChatInputArea