feat: add image selection to Assets step and remove duplicate media library
This commit is contained in:
parent
b3418e3c96
commit
cdbc5062ca
@ -226,6 +226,8 @@ export default function EditorShell({ onLogout, initialPostId, onBack }: { onLog
|
||||
}
|
||||
}}
|
||||
onSetFeature={(url: string) => setMeta(m => ({ ...m, featureImage: url }))}
|
||||
selectedKeys={genImageKeys}
|
||||
onToggleSelect={toggleGenImage}
|
||||
/>
|
||||
</StepContainer>
|
||||
)}
|
||||
|
||||
@ -131,8 +131,7 @@ export default function MediaLibrary({
|
||||
|
||||
return (
|
||||
<Paper sx={{ p: 2 }}>
|
||||
<Stack direction="row" justifyContent="space-between" alignItems="center" sx={{ mb: 2 }}>
|
||||
<Typography variant="h6">Media Library</Typography>
|
||||
<Stack direction="row" justifyContent="flex-end" alignItems="center" sx={{ mb: 2 }}>
|
||||
<Stack direction="row" spacing={1} alignItems="center">
|
||||
<TextField
|
||||
size="small"
|
||||
|
||||
@ -10,12 +10,16 @@ export default function StepAssets({
|
||||
onInsertAtCursor,
|
||||
onInsertImage,
|
||||
onSetFeature,
|
||||
selectedKeys,
|
||||
onToggleSelect,
|
||||
}: {
|
||||
draftId?: string | null;
|
||||
postClips: Clip[];
|
||||
onInsertAtCursor: (html: string) => void;
|
||||
onInsertImage: (url: string) => void;
|
||||
onSetFeature: (url: string) => void;
|
||||
selectedKeys?: string[];
|
||||
onToggleSelect?: (key: string) => void;
|
||||
}) {
|
||||
return (
|
||||
<Box sx={{ display: 'grid', gap: 2 }}>
|
||||
@ -33,6 +37,9 @@ export default function StepAssets({
|
||||
onInsert={onInsertImage}
|
||||
onSetFeature={onSetFeature}
|
||||
showSetFeature
|
||||
selectionMode
|
||||
selectedKeys={selectedKeys}
|
||||
onToggleSelect={onToggleSelect}
|
||||
/>
|
||||
</Box>
|
||||
</Stack>
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
import { Box, Stack, TextField, Typography } from '@mui/material';
|
||||
import MediaLibrary from '../MediaLibrary';
|
||||
import SelectedImages from './SelectedImages';
|
||||
import CollapsibleSection from './CollapsibleSection';
|
||||
import type { Clip } from './StepAssets';
|
||||
@ -46,10 +45,7 @@ export default function StepGenerate({
|
||||
<SelectedImages imageKeys={genImageKeys} onRemove={onToggleGenImage} />
|
||||
</CollapsibleSection>
|
||||
|
||||
{/* Media library */}
|
||||
<CollapsibleSection title="Media Library">
|
||||
<MediaLibrary selectionMode selectedKeys={genImageKeys} onToggleSelect={onToggleGenImage} />
|
||||
</CollapsibleSection>
|
||||
{/* Media library removed: selection now happens in Assets step */}
|
||||
|
||||
{/* Prompt */}
|
||||
<CollapsibleSection title="AI Prompt">
|
||||
|
||||
Loading…
Reference in New Issue
Block a user