import React from 'react'; import styled from 'styled-components'; import { Typography, FormControlLabel, Checkbox, Box } from '@mui/material'; import { useActionContext } from '../../context/browserActions'; import MaxunLogo from "../../assets/maxunlogo.png"; import { useTranslation } from 'react-i18next'; interface CustomBoxContainerProps { isDarkMode: boolean; } const CustomBoxContainer = styled.div` position: relative; min-width: 250px; width: auto; min-height: 100px; height: auto; border-radius: 5px; background-color: ${({ isDarkMode }) => (isDarkMode ? '#313438' : 'white')}; color: ${({ isDarkMode }) => (isDarkMode ? 'white' : 'black')}; margin: 80px 13px 25px 13px; box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1); `; const Triangle = styled.div` position: absolute; top: -15px; left: 50%; transform: translateX(-50%); width: 0; height: 0; border-left: 20px solid transparent; border-right: 20px solid transparent; border-bottom: 20px solid ${({ isDarkMode }) => (isDarkMode ? '#313438' : 'white')}; `; const Logo = styled.img` position: absolute; top: -80px; left: 50%; transform: translateX(-50%); width: 70px; height: auto; border-radius: 5px; `; const Content = styled.div` padding: 20px; text-align: left; `; const ActionDescriptionBox = ({ isDarkMode }: { isDarkMode: boolean }) => { const { t } = useTranslation(); const { getText, getScreenshot, getList, captureStage } = useActionContext() as { getText: boolean; getScreenshot: boolean; getList: boolean; captureStage: 'initial' | 'pagination' | 'limit' | 'complete'; }; const messages = [ { stage: 'initial' as const, text: t('action_description.list_stages.initial') }, { stage: 'pagination' as const, text: t('action_description.list_stages.pagination') }, { stage: 'limit' as const, text: t('action_description.list_stages.limit') }, { stage: 'complete' as const, text: t('action_description.list_stages.complete') }, ]; const stages = messages.map(({ stage }) => stage); const currentStageIndex = stages.indexOf(captureStage); const renderActionDescription = () => { if (getText) { return ( <> {t('action_description.text.title')} {t('action_description.text.description')} ); } else if (getScreenshot) { return ( <> {t('action_description.screenshot.title')} {t('action_description.screenshot.description')} ); } else if (getList) { return ( <> {t('action_description.list.title')} {t('action_description.list.description')} {messages.map(({ stage, text }, index) => ( } label={ {text} } /> ))} ); } else { return ( <> {t('action_description.default.title')} {t('action_description.default.description')} ); } }; return ( {renderActionDescription()} ); }; export default ActionDescriptionBox;