fix: -rm tutorial mode
This commit is contained in:
@@ -22,10 +22,9 @@ import { useBrowserSteps } from '../../context/browserSteps';
|
|||||||
interface InterpretationLogProps {
|
interface InterpretationLogProps {
|
||||||
isOpen: boolean;
|
isOpen: boolean;
|
||||||
setIsOpen: (isOpen: boolean) => void;
|
setIsOpen: (isOpen: boolean) => void;
|
||||||
tutorialMode?: boolean;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export const InterpretationLog: React.FC<InterpretationLogProps> = ({ isOpen, setIsOpen, tutorialMode = false }) => {
|
export const InterpretationLog: React.FC<InterpretationLogProps> = ({ isOpen, setIsOpen }) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
const [captureListData, setCaptureListData] = useState<any[]>([]);
|
const [captureListData, setCaptureListData] = useState<any[]>([]);
|
||||||
@@ -146,15 +145,6 @@ export const InterpretationLog: React.FC<InterpretationLogProps> = ({ isOpen, se
|
|||||||
}
|
}
|
||||||
}, [hasScrapeListAction, hasScrapeSchemaAction, hasScreenshotAction, setIsOpen]);
|
}, [hasScrapeListAction, hasScrapeSchemaAction, hasScreenshotAction, setIsOpen]);
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (
|
|
||||||
tutorialMode &&
|
|
||||||
(hasScrapeListAction || hasScrapeSchemaAction || hasScreenshotAction)
|
|
||||||
) {
|
|
||||||
setShowPreviewData(true);
|
|
||||||
setIsOpen(true); // auto-open drawer
|
|
||||||
}
|
|
||||||
}, [tutorialMode, hasScrapeListAction, hasScrapeSchemaAction, hasScreenshotAction, setIsOpen]);
|
|
||||||
|
|
||||||
const { darkMode } = useThemeMode();
|
const { darkMode } = useThemeMode();
|
||||||
|
|
||||||
@@ -311,14 +301,13 @@ export const InterpretationLog: React.FC<InterpretationLogProps> = ({ isOpen, se
|
|||||||
</TableHead>
|
</TableHead>
|
||||||
<TableBody>
|
<TableBody>
|
||||||
{(captureListData[captureListPage]?.data || [])
|
{(captureListData[captureListPage]?.data || [])
|
||||||
.slice(0, tutorialMode ? (captureListData[captureListPage]?.data?.length || 0) : Math.min(captureListData[captureListPage]?.limit || 10, 5))
|
.slice(0, Math.min(captureListData[captureListPage]?.limit || 10, 5))
|
||||||
.map((row: any, rowIndex: any) => (
|
.map((row: any, rowIndex: any) => (
|
||||||
<TableRow
|
<TableRow
|
||||||
key={rowIndex}
|
key={rowIndex}
|
||||||
sx={{
|
sx={{
|
||||||
borderBottom: rowIndex < (tutorialMode
|
borderBottom: rowIndex < (
|
||||||
? (captureListData[captureListPage]?.data?.length || 0)
|
Math.min((captureListData[captureListPage]?.data?.length || 0), Math.min(captureListData[captureListPage]?.limit || 10, 5))
|
||||||
: Math.min((captureListData[captureListPage]?.data?.length || 0), Math.min(captureListData[captureListPage]?.limit || 10, 5))
|
|
||||||
) - 1 ? '1px solid' : 'none',
|
) - 1 ? '1px solid' : 'none',
|
||||||
borderColor: darkMode ? '#080808ff' : '#dee2e6'
|
borderColor: darkMode ? '#080808ff' : '#dee2e6'
|
||||||
}}
|
}}
|
||||||
@@ -459,9 +448,6 @@ export const InterpretationLog: React.FC<InterpretationLogProps> = ({ isOpen, se
|
|||||||
<Typography variant="h6" gutterBottom align="left">
|
<Typography variant="h6" gutterBottom align="left">
|
||||||
{t('interpretation_log.messages.successful_training')}
|
{t('interpretation_log.messages.successful_training')}
|
||||||
</Typography>
|
</Typography>
|
||||||
{!tutorialMode && (
|
|
||||||
<SidePanelHeader onPreviewClick={() => setShowPreviewData(true)} />
|
|
||||||
)}
|
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
<Typography variant="h6" gutterBottom align="left">
|
<Typography variant="h6" gutterBottom align="left">
|
||||||
|
|||||||
Reference in New Issue
Block a user