Files
parcer/src/components/molecules/SidePanelHeader.tsx

30 lines
744 B
TypeScript
Raw Normal View History

2024-06-24 22:39:54 +05:30
import React, { FC, useState } from 'react';
import { InterpretationButtons } from "./InterpretationButtons";
import { useSocketStore } from "../../context/socket";
2024-10-19 18:46:45 +05:30
export const SidePanelHeader = () => {
2024-06-24 22:39:54 +05:30
2024-10-19 14:02:30 +05:30
const [steppingIsDisabled, setSteppingIsDisabled] = useState(true);
2024-10-19 18:46:45 +05:30
2024-10-19 14:02:30 +05:30
const { socket } = useSocketStore();
2024-06-24 22:39:54 +05:30
2024-10-19 14:02:30 +05:30
const handleStep = () => {
socket?.emit('step');
};
2024-06-24 22:39:54 +05:30
2024-10-19 14:02:30 +05:30
return (
<div style={{ width: 'inherit' }}>
2024-10-19 18:46:45 +05:30
<InterpretationButtons enableStepping={(isPaused) => setSteppingIsDisabled(!isPaused)} />
2024-10-19 14:02:30 +05:30
{/* <Button
2024-06-24 22:39:54 +05:30
variant='outlined'
disabled={steppingIsDisabled}
onClick={handleStep}
sx={{marginLeft:'15px'}}
>
step
<FastForward/>
2024-10-19 14:02:08 +05:30
</Button> */}
2024-10-19 14:02:30 +05:30
</div>
);
2024-06-24 22:39:54 +05:30
};