ENCOA-277, ENCOA-276, ENCOA-282, ENCOA-283
This commit is contained in:
@@ -6,6 +6,7 @@ import { Card, CardContent } from '@/components/ui/card';
|
||||
import Input from '@/components/Low/Input';
|
||||
import { FaFemale, FaMale, FaPlus } from 'react-icons/fa';
|
||||
import clsx from 'clsx';
|
||||
import { toast } from 'react-toastify';
|
||||
|
||||
export interface Speaker {
|
||||
id: number;
|
||||
@@ -65,7 +66,7 @@ const ScriptEditor: React.FC<Props> = ({ section, editing = false, local, setLoc
|
||||
position: index % 2 === 0 ? 'left' : 'right'
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
const existingScript = local as ScriptLine[];
|
||||
const existingSpeakers = new Set<string>();
|
||||
const speakerGenders = new Map<string, 'male' | 'female'>();
|
||||
@@ -217,6 +218,12 @@ const ScriptEditor: React.FC<Props> = ({ section, editing = false, local, setLoc
|
||||
}, [local]);
|
||||
|
||||
if (!isConversation) {
|
||||
if (typeof local !== 'string') {
|
||||
toast.error(`Section ${section} is monologue based, but the import contained a conversation!`);
|
||||
setLocal('');
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<Card>
|
||||
<CardContent className="py-10">
|
||||
@@ -238,6 +245,12 @@ const ScriptEditor: React.FC<Props> = ({ section, editing = false, local, setLoc
|
||||
);
|
||||
}
|
||||
|
||||
if (typeof local === 'string') {
|
||||
toast.error(`Section ${section} is conversation based, but the import contained a monologue!`);
|
||||
setLocal([]);
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<Card>
|
||||
<CardContent className="py-10">
|
||||
|
||||
Reference in New Issue
Block a user