wip: render action description

This commit is contained in:
karishmas6
2024-10-19 06:45:10 +05:30
parent 3838f09b7a
commit ea92bcebff

View File

@@ -1,5 +1,6 @@
import React, { ReactNode } from 'react'; import React, { ReactNode } from 'react';
import styled from 'styled-components'; import styled from 'styled-components';
import { PaginationType, useActionContext, LimitType } from '../../context/browserActions';
const CustomBoxContainer = styled.div` const CustomBoxContainer = styled.div`
position: relative; position: relative;
@@ -27,11 +28,31 @@ const Content = styled.div`
text-align: center; 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 <p>Getting text...</p>;
} else if (getScreenshot) {
return <p>Getting screenshot...</p>;
} else if (getList) {
return <p>Getting list...</p>;
} else {
return (
<div>
<p>Defauly</p>
</div>
);
}
}
return ( return (
<CustomBoxContainer> <CustomBoxContainer>
<Triangle /> <Triangle />
<Content>{children}</Content> <Content>
{renderActionDescription()}
</Content>
</CustomBoxContainer> </CustomBoxContainer>
); );
}; };