feat: move from BrowserWindow.tsx
This commit is contained in:
@@ -4,34 +4,27 @@ import { Box, Button, IconButton, Stack, Typography } from "@mui/material";
|
|||||||
|
|
||||||
interface ConfirmationBoxProps {
|
interface ConfirmationBoxProps {
|
||||||
selector: string;
|
selector: string;
|
||||||
onClose: () => void;
|
onYes: () => void;
|
||||||
|
onNo: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
const ConfirmationBox = ({ selector, onClose }: ConfirmationBoxProps) => {
|
export const ConfirmationBox = ({ selector, onYes, onNo }: ConfirmationBoxProps) => {
|
||||||
return (
|
return (
|
||||||
<React.Fragment>
|
<Box sx={{ textAlign: 'center' }}>
|
||||||
<Typography>
|
<Typography variant="h6" component="h2" gutterBottom>
|
||||||
Do you want to proceed?
|
Confirmation
|
||||||
</Typography>
|
</Typography>
|
||||||
<Box style={{ marginTop: '4px' }}>
|
<Typography variant="body1" gutterBottom>
|
||||||
Selector: {selector}
|
Do you want to interact with the element: {selector}?
|
||||||
<pre>{selector}</pre>
|
</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>
|
</Box>
|
||||||
</React.Fragment>
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const ConfirmationBoxContainer = styled.div`
|
|
||||||
position: fixed;
|
|
||||||
top: 50%;
|
|
||||||
left: 50%;
|
|
||||||
transform: translate(-50%, -50%);
|
|
||||||
background: white;
|
|
||||||
border: 1px solid #ccc;
|
|
||||||
padding: 20px;
|
|
||||||
box-shadow: 0 4px 8px rgba(0,0,0,0.1);
|
|
||||||
z-index: 2147483648; /* Ensure it's above the highlighter */
|
|
||||||
text-align: center;
|
|
||||||
`;
|
|
||||||
|
|
||||||
export default ConfirmationBox;
|
|
||||||
Reference in New Issue
Block a user