Commit 1ab89cbd authored by Paranagama R.P.S.D.'s avatar Paranagama R.P.S.D.

feat : Cosmetic changes

parent 9f60708f
import { useRef, useState } from 'react';
import { Button, Grid } from '@mui/material';
import Webcam from 'react-webcam';
import { PauseCircleOutlined, PlayCircleOutlined } from '@ant-design/icons';
//@ts-ignore
const WebcamStreamCapture = ({ onVideoRecorded }) => {
const webcamRef = useRef(null);
......@@ -54,20 +55,11 @@ const WebcamStreamCapture = ({ onVideoRecorded }) => {
<Grid item xs={12}>
<center>
{capturing ? (
// ! Add Icon
// <Button onClick={handleStopCaptureClick} startIcon={<StopIcon />} color="error" variant="contained">
// Stop Capture
// </Button>
<Button onClick={handleStopCaptureClick} color="error" variant="contained">
<Button onClick={handleStopCaptureClick} startIcon={<PauseCircleOutlined />} color="error" variant="contained">
Stop Capture
</Button>
) : (
// ! Add Icon
// <Button onClick={handleStartCaptureClick} startIcon={<RadioButtonCheckedIcon />} color="error" variant="contained">
// Start Capture
// </Button>
<Button onClick={handleStartCaptureClick} color="error" variant="contained">
<Button onClick={handleStartCaptureClick} startIcon={<PlayCircleOutlined />} color="error" variant="contained">
Start Capture
</Button>
)}
......
......@@ -11,6 +11,7 @@ import {
CardHeader,
Container,
Grid,
IconButton,
InputAdornment,
LinearProgress,
Paper,
......@@ -26,6 +27,7 @@ import { useState } from 'react';
import { useSnackbar } from 'notistack';
import { CloudUploadOutlined, CopyOutlined, TranslationOutlined, VideoCameraOutlined } from '@ant-design/icons';
import { MuiFileInput } from 'mui-file-input';
import SignLanguageToTextService from '../../../services/SignLanguageToText.js';
import WebcamStreamCapture from './WebcamStreamCapture';
......@@ -45,19 +47,6 @@ const Process = () => {
const [speed, setSpeed] = useState(0);
const [recordedVideoUrl, setRecordedVideoUrl] = useState(null);
// const handleDropSingleFile = useCallback(async (acceptedFiles: File[]) => {
// const file = acceptedFiles[0];
// if (file) {
// setFile(
// Object.assign(file, {
// preview: URL.createObjectURL(file)
// })
// );
// setVideoUrl(URL.createObjectURL(file));
// }
// }, []);
const handleDropSingleFile = (files: any) => {
if (files) {
setFile(
......@@ -87,14 +76,12 @@ const Process = () => {
const { enqueueSnackbar } = useSnackbar();
// const { copy } = useCopyToClipboard();
// const onCopy = (text: string) => {
// if (text) {
// enqueueSnackbar('Copied!');
// copy(text);
// }
// };
const onCopy = (text: string) => {
if (text) {
navigator.clipboard.writeText(text);
enqueueSnackbar('Copied!', { variant: 'success' });
}
};
const handleChange = (event: React.ChangeEvent<HTMLTextAreaElement>) => {
setValue(event.target.value);
......@@ -177,45 +164,25 @@ const Process = () => {
}}
>
<ButtonGroup disableElevation variant="contained" aria-label="Disabled elevation buttons">
{/* ! Important - Add Icon */}
<Button
variant={checkTranalationTypeForUpload()}
startIcon={<CloudUploadOutlined />}
onClick={() => {
setIsUploadFile(true);
}}
>
Upload
</Button>
{/* <Button
variant={checkTranalationTypeForUpload()}
startIcon={<UploadIcon />}
onClick={() => {
setIsUploadFile(true);
}}
>
Upload
</Button> */}
{/* ! Important - Add Icon */}
<Button
variant={checkTranalationTypeForRecord()}
startIcon={<VideoCameraOutlined />}
onClick={() => {
setIsUploadFile(false);
}}
>
Record
</Button>
{/*
<Button
variant={checkTranalationTypeForRecord()}
startIcon={<EmergencyRecordingIcon />}
onClick={() => {
setIsUploadFile(false);
}}
>
Record
</Button> */}
</ButtonGroup>
{isUploadFile ? (
<Box sx={{ flexGrow: 1 }}>
......@@ -273,6 +240,7 @@ const Process = () => {
onClick={() => {
translateSignLanguageToText();
}}
endIcon={<TranslationOutlined />}
>
Translate
</Button>
......@@ -302,12 +270,9 @@ const Process = () => {
InputProps={{
endAdornment: (
<InputAdornment position="end">
{/* <Tooltip title="Copy"> */}
{/* Important */}
{/* <IconButton onClick={() => onCopy(value)}>
<Iconify icon="eva:copy-fill" width={24} />
</IconButton> */}
{/* </Tooltip> */}
<IconButton onClick={() => onCopy(value)}>
<CopyOutlined />
</IconButton>
</InputAdornment>
)
}}
......@@ -373,6 +338,7 @@ const Process = () => {
onClick={() => {
translateSignLanguageToTextRecord();
}}
endIcon={<TranslationOutlined />}
>
Translate
</Button>
......@@ -402,11 +368,9 @@ const Process = () => {
InputProps={{
endAdornment: (
<InputAdornment position="end">
{/* <Tooltip title="Copy"> */}
{/* <IconButton onClick={() => onCopy(value)}>
<Iconify icon="eva:copy-fill" width={24} />
</IconButton> */}
{/* </Tooltip> */}
<IconButton onClick={() => onCopy(value)}>
<CopyOutlined />
</IconButton>
</InputAdornment>
)
}}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment