frontPanel/src/pages/ResultPage/SwichResult.tsx

45 lines
1.1 KiB
TypeScript
Raw Normal View History

import { Box, FormControlLabel } from "@mui/material";
import CustomizedSwitch from "@ui_kit/CustomSwitch";
import * as React from "react";
2023-04-15 09:10:59 +00:00
interface Props {
2023-04-15 09:10:59 +00:00
text: string;
icon: string;
onClick?: (a:any) => void;
value: boolean
}
export const SwitchSetting = ({ text, icon, onClick, value }: Props) => {
2023-04-15 09:10:59 +00:00
return (
<Box
sx={{
p: "14px",
mb: "14px",
display: "flex",
justifyContent: "space-between",
border: "1px solid #9A9AAF",
borderRadius: "8px",
alignItems: "center",
}}
>
<Box sx={{ display: "flex", alignItems: "center", justifyContent: "left", maxWidth: "756px", width: "100%" }}>
2023-04-15 09:10:59 +00:00
<img src={icon} alt="icon" />
<FormControlLabel
checked={value}
control={<CustomizedSwitch />}
label={text}
labelPlacement="start"
sx={{
display: "flex",
justifyContent: "space-between",
color: "#9A9AAF",
width: "100%",
paddingRight: "15px",
}}
onClick={onClick}
/>
</Box>
2023-04-15 09:10:59 +00:00
</Box>
);
2023-04-23 08:39:34 +00:00
};