feat: wrap assets step components in collapsible sections and remove draft ID display
This commit is contained in:
parent
cdbc5062ca
commit
5efc6c690e
@ -249,14 +249,13 @@ export default function EditorShell({ onLogout, initialPostId, onBack }: { onLog
|
|||||||
/>
|
/>
|
||||||
<Stack direction="row" spacing={1}>
|
<Stack direction="row" spacing={1}>
|
||||||
<Button variant="contained" disabled>Generate Draft (Coming Soon)</Button>
|
<Button variant="contained" disabled>Generate Draft (Coming Soon)</Button>
|
||||||
<Button variant="outlined" onClick={() => setActiveStep(3)}>Skip to Edit</Button>
|
|
||||||
</Stack>
|
</Stack>
|
||||||
</StepContainer>
|
</StepContainer>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{activeStep === 3 && (
|
{activeStep === 3 && (
|
||||||
<StepContainer>
|
<StepContainer>
|
||||||
<StepEdit editorRef={editorRef as any} draftHtml={draft} onChangeDraft={setDraft} draftId={draftId} />
|
<StepEdit editorRef={editorRef as any} draftHtml={draft} onChangeDraft={setDraft} />
|
||||||
</StepContainer>
|
</StepContainer>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
import { Box, Stack, Typography } from '@mui/material';
|
import { Box, Stack, Typography } from '@mui/material';
|
||||||
import Recorder from '../../features/recorder/Recorder';
|
import Recorder from '../../features/recorder/Recorder';
|
||||||
import MediaLibrary from '../MediaLibrary';
|
import MediaLibrary from '../MediaLibrary';
|
||||||
|
import CollapsibleSection from './CollapsibleSection';
|
||||||
|
|
||||||
export type Clip = { id: string; bucket: string; key: string; mime: string; transcript?: string; createdAt: string };
|
export type Clip = { id: string; bucket: string; key: string; mime: string; transcript?: string; createdAt: string };
|
||||||
|
|
||||||
@ -26,21 +27,25 @@ export default function StepAssets({
|
|||||||
<Typography variant="subtitle1">Assets (Audio & Images)</Typography>
|
<Typography variant="subtitle1">Assets (Audio & Images)</Typography>
|
||||||
<Stack direction={{ xs: 'column', md: 'row' }} spacing={2} alignItems="stretch">
|
<Stack direction={{ xs: 'column', md: 'row' }} spacing={2} alignItems="stretch">
|
||||||
<Box sx={{ flex: 1 }}>
|
<Box sx={{ flex: 1 }}>
|
||||||
<Recorder
|
<CollapsibleSection title="Audio Recorder">
|
||||||
postId={draftId ?? undefined}
|
<Recorder
|
||||||
onInsertAtCursor={onInsertAtCursor}
|
postId={draftId ?? undefined}
|
||||||
initialClips={postClips}
|
onInsertAtCursor={onInsertAtCursor}
|
||||||
/>
|
initialClips={postClips}
|
||||||
|
/>
|
||||||
|
</CollapsibleSection>
|
||||||
</Box>
|
</Box>
|
||||||
<Box sx={{ flex: 1 }}>
|
<Box sx={{ flex: 1 }}>
|
||||||
<MediaLibrary
|
<CollapsibleSection title="Media Library">
|
||||||
onInsert={onInsertImage}
|
<MediaLibrary
|
||||||
onSetFeature={onSetFeature}
|
onInsert={onInsertImage}
|
||||||
showSetFeature
|
onSetFeature={onSetFeature}
|
||||||
selectionMode
|
showSetFeature
|
||||||
selectedKeys={selectedKeys}
|
selectionMode
|
||||||
onToggleSelect={onToggleSelect}
|
selectedKeys={selectedKeys}
|
||||||
/>
|
onToggleSelect={onToggleSelect}
|
||||||
|
/>
|
||||||
|
</CollapsibleSection>
|
||||||
</Box>
|
</Box>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Box>
|
</Box>
|
||||||
|
|||||||
@ -6,12 +6,10 @@ export default function StepEdit({
|
|||||||
editorRef,
|
editorRef,
|
||||||
draftHtml,
|
draftHtml,
|
||||||
onChangeDraft,
|
onChangeDraft,
|
||||||
draftId,
|
|
||||||
}: {
|
}: {
|
||||||
editorRef: ForwardedRef<RichEditorHandle> | any;
|
editorRef: ForwardedRef<RichEditorHandle> | any;
|
||||||
draftHtml: string;
|
draftHtml: string;
|
||||||
onChangeDraft: (html: string) => void;
|
onChangeDraft: (html: string) => void;
|
||||||
draftId?: string | null;
|
|
||||||
}) {
|
}) {
|
||||||
return (
|
return (
|
||||||
<Box>
|
<Box>
|
||||||
@ -24,9 +22,6 @@ export default function StepEdit({
|
|||||||
}}>
|
}}>
|
||||||
<RichEditor ref={editorRef} value={draftHtml} onChange={onChangeDraft} placeholder="Write your post..." />
|
<RichEditor ref={editorRef} value={draftHtml} onChange={onChangeDraft} placeholder="Write your post..." />
|
||||||
</Box>
|
</Box>
|
||||||
{draftId && (
|
|
||||||
<Typography variant="caption" sx={{ mt: 1, display: 'block' }}>ID: {draftId}</Typography>
|
|
||||||
)}
|
|
||||||
</Box>
|
</Box>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user