| 1 | /** |
| 2 | * AiBatchGenerateBar |
| 3 | */ |
| 4 | |
| 5 | 'use client' |
| 6 | |
| 7 | import type { AiBatchGenerateBarProps } from './types' |
| 8 | import { memo } from 'react' |
| 9 | import { CaptionPromptField } from './components/CaptionPromptField' |
| 10 | import { DragUploadOverlay } from './components/DragUploadOverlay' |
| 11 | import { PromptComposer } from './components/PromptComposer' |
| 12 | import PromptEditorDialog from './components/PromptEditorDialog' |
| 13 | import ToolBarInline from './components/ToolBarInline' |
| 14 | import { useAiBatchGenerateBarController } from './hooks/useAiBatchGenerateBarController' |
| 15 | |
| 16 | const AiBatchGenerateBar = memo((props: AiBatchGenerateBarProps) => { |
| 17 | const { |
| 18 | containerProps, |
| 19 | promptComposerProps, |
| 20 | toolBarProps, |
| 21 | captionPromptFieldProps, |
| 22 | promptEditorDialogProps, |
| 23 | dragUploadOverlayLabel, |
| 24 | } = useAiBatchGenerateBarController(props) |
| 25 | |
| 26 | return ( |
| 27 | <div {...containerProps}> |
| 28 | <PromptComposer {...promptComposerProps} /> |
| 29 | |
| 30 | <div className="px-4 pb-3 pt-0"> |
| 31 | <ToolBarInline {...toolBarProps} /> |
| 32 | </div> |
| 33 | |
| 34 | {captionPromptFieldProps && <CaptionPromptField {...captionPromptFieldProps} />} |
| 35 | |
| 36 | {promptEditorDialogProps && <PromptEditorDialog {...promptEditorDialogProps} />} |
| 37 | |
| 38 | {dragUploadOverlayLabel && <DragUploadOverlay label={dragUploadOverlayLabel} />} |
| 39 | </div> |
| 40 | ) |
| 41 | }) |
| 42 | |
| 43 | AiBatchGenerateBar.displayName = 'AiBatchGenerateBar' |
| 44 | |
| 45 | export default AiBatchGenerateBar |
| 46 |