chore: lint

This commit is contained in:
karishmas6
2024-07-24 18:13:53 +05:30
parent 0b3a340725
commit e04c27e122

View File

@@ -14,24 +14,24 @@ interface ConfirmationBoxProps {
// New component for the confirmation box inside the modal
const ConfirmationBox = ({ selector, onYes, onNo }: ConfirmationBoxProps) => {
return (
<Box sx={{ textAlign: 'center' }}>
<Typography variant="h6" component="h2" gutterBottom>
Confirmation
</Typography>
<Typography variant="body1" gutterBottom>
Do you want to interact with the element: {selector}?
</Typography>
<Box sx={{ mt: 2, display: 'flex', justifyContent: 'center', gap: 2 }}>
<Button variant="contained" color="primary" onClick={onYes}>
Yes
</Button>
<Button variant="contained" color="secondary" onClick={onNo}>
No
</Button>
</Box>
</Box>
);
return (
<Box sx={{ textAlign: 'center' }}>
<Typography variant="h6" component="h2" gutterBottom>
Confirmation
</Typography>
<Typography variant="body1" gutterBottom>
Do you want to interact with the element: {selector}?
</Typography>
<Box sx={{ mt: 2, display: 'flex', justifyContent: 'center', gap: 2 }}>
<Button variant="contained" color="primary" onClick={onYes}>
Yes
</Button>
<Button variant="contained" color="secondary" onClick={onNo}>
No
</Button>
</Box>
</Box>
);
};
export const BrowserWindow = () => {
@@ -99,7 +99,7 @@ export const BrowserWindow = () => {
const canvasRect = canvasRef.current.getBoundingClientRect();
const clickX = e.clientX - canvasRect.left;
const clickY = e.clientY - canvasRect.top;
const highlightRect = highlighterData.rect;
if (
clickX >= highlightRect.left &&
@@ -126,17 +126,17 @@ export const BrowserWindow = () => {
<div onClick={handleClick}>
{
showConfirmation ? (
<GenericModal
isOpen={showConfirmation}
onClose={() => setShowConfirmation(false)}
canBeClosed={false}
>
<ConfirmationBox
selector={highlighterData?.selector || ''}
onYes={() => handleConfirmation(true)}
onNo={() => handleConfirmation(false)}
/>
</GenericModal>
<GenericModal
isOpen={showConfirmation}
onClose={() => setShowConfirmation(false)}
canBeClosed={false}
>
<ConfirmationBox
selector={highlighterData?.selector || ''}
onYes={() => handleConfirmation(true)}
onNo={() => handleConfirmation(false)}
/>
</GenericModal>
) : null
}
{(!showConfirmation && highlighterData?.rect != null && highlighterData?.rect.top != null) && canvasRef?.current ?