frontPanel/src/components/SwichResult.tsx

66 lines
2.0 KiB
TypeScript
Raw Normal View History

import {Box, FormControlLabel, IconButton, Typography} from "@mui/material";
2023-04-15 09:10:59 +00:00
import { useState } from "react";
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: any;
onClick?: () => void
}
export const SwitchSetting = ({ text, icon, onClick }: Props) => {
// const [active, setActive] = useState<boolean>(false);
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" />
{/*<Typography sx={{ color: "#9A9AAF", ml: "14px" }}>{text}</Typography>*/}
<FormControlLabel
value="start"
control={<CustomizedSwitch/>}
label={text}
labelPlacement="start"
sx={{
display: 'flex',
justifyContent: 'space-between',
color: "#9A9AAF",
width: "100%",
paddingRight: "15px"
}}
onClick={onClick}
2023-04-15 09:10:59 +00:00
/>
</Box>
{/*<IconButton disableRipple onClick={() => setActive(!active)}>*/}
{/* <svg width="52" height="30" viewBox="0 0 52 30" fill="none" xmlns="http://www.w3.org/2000/svg">*/}
{/* <rect width="52" height="30" rx="15" fill={active ? "#7E2AEA" : "#9A9AAF"} />*/}
{/* <rect*/}
{/* x={active ? "23" : "1"}*/}
{/* y="1"*/}
{/* width="28"*/}
{/* height="28"*/}
{/* rx="14"*/}
{/* fill="white"*/}
{/* stroke={active ? "#7E2AEA" : "#9A9AAF"}*/}
{/* strokeWidth="2"*/}
{/* />*/}
{/* </svg>*/}
{/*</IconButton>*/}
2023-04-15 09:10:59 +00:00
</Box>
);
2023-04-23 08:39:34 +00:00
};