feat: use recordingUrl

This commit is contained in:
karishmas6
2024-10-11 04:57:48 +05:30
parent 2ed09970e9
commit 08abedee03

View File

@@ -21,11 +21,12 @@ interface NavBarProps {
export const NavBar: React.FC<NavBarProps> = ({ newRecording, recordingName, isRecording }) => { export const NavBar: React.FC<NavBarProps> = ({ newRecording, recordingName, isRecording }) => {
const { notify, browserId, setBrowserId, recordingLength } = useGlobalInfoStore(); const { notify, browserId, setBrowserId, recordingLength, recordingUrl, setRecordingUrl } = useGlobalInfoStore();
const { state, dispatch } = useContext(AuthContext); const { state, dispatch } = useContext(AuthContext);
const { user } = state; const { user } = state;
const [isModalOpen, setModalOpen] = useState(false); const [isModalOpen, setModalOpen] = useState(false);
const [url, setUrl] = useState('');
console.log(`Recording URL: ${recordingUrl}`)
const navigate = useNavigate(); const navigate = useNavigate();
@@ -59,7 +60,7 @@ export const NavBar: React.FC<NavBarProps> = ({ newRecording, recordingName, isR
const startRecording = () => { const startRecording = () => {
setModalOpen(false); setModalOpen(false);
newRecording(); newRecording();
notify('info', 'New Recording started for ' + url); notify('info', 'New Recording started for ' + recordingUrl);
}; };
return ( return (
@@ -150,15 +151,15 @@ export const NavBar: React.FC<NavBarProps> = ({ newRecording, recordingName, isR
label="URL" label="URL"
variant="outlined" variant="outlined"
fullWidth fullWidth
value={url} value={recordingUrl}
onChange={(e: any) => setUrl(e.target.value)} onChange={(e: any) => setRecordingUrl(e.target.value)}
style={{ marginBottom: '20px' }} style={{ marginBottom: '20px' }}
/> />
<Button <Button
variant="contained" variant="contained"
color="primary" color="primary"
onClick={startRecording} onClick={startRecording}
disabled={!url} disabled={!recordingUrl}
> >
Submit & Start Recording Submit & Start Recording
</Button> </Button>