From ea92bcebff6a1611016458084121140e42ae81ca Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Sat, 19 Oct 2024 06:45:10 +0530 Subject: [PATCH] wip: render action description --- .../molecules/ActionDescriptionBox.tsx | 25 +++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/src/components/molecules/ActionDescriptionBox.tsx b/src/components/molecules/ActionDescriptionBox.tsx index 8ead5a26..2b6ca1ff 100644 --- a/src/components/molecules/ActionDescriptionBox.tsx +++ b/src/components/molecules/ActionDescriptionBox.tsx @@ -1,5 +1,6 @@ import React, { ReactNode } from 'react'; import styled from 'styled-components'; +import { PaginationType, useActionContext, LimitType } from '../../context/browserActions'; const CustomBoxContainer = styled.div` position: relative; @@ -27,11 +28,31 @@ const Content = styled.div` text-align: center; `; -const ActionDescriptionBox = ({ children }: { children: ReactNode }) => { +const ActionDescriptionBox = () => { + const { getText, startGetText, stopGetText, getScreenshot, startGetScreenshot, stopGetScreenshot, getList, startGetList, stopGetList, startPaginationMode, stopPaginationMode, paginationType, updatePaginationType, limitType, customLimit, updateLimitType, updateCustomLimit, stopLimitMode, startLimitMode } = useActionContext(); + + const renderActionDescription = () => { + if (getText) { + return

Getting text...

; + } else if (getScreenshot) { + return

Getting screenshot...

; + } else if (getList) { + return

Getting list...

; + } else { + return ( +
+

Defauly

+
+ ); + } + } + return ( - {children} + + {renderActionDescription()} + ); };