import { DeleteOutline, FileOpenOutlined } from "@mui/icons-material"; import { Box, Button, Stack, TextField } from "@mui/material"; import { open } from "@tauri-apps/api/dialog"; import { useAtom } from "jotai"; import Image from "next/image"; import { FC } from "react"; import { stagedSettingsAtom } from "../../../../lib/store/jotai/settings"; import { CategoryTitle } from "../CategoryTitle"; import { SettingsItem } from "../SettingsItem"; interface SettingsTabBackgroundProps { sx?: any; } export const SettingsTabBackground: FC = ({ sx }) => { // atoms const [stagedSettings, setStagedSettings] = useAtom(stagedSettingsAtom); const handleSettingsBackgroundValueChange = ( settingKey: string, settingValue: boolean | number | string | number[], ) => { const newSettings = { ...stagedSettings, background: { ...stagedSettings.background, [settingKey]: settingValue, }, }; setStagedSettings(newSettings); }; const selectImage = async () => { const selected = await open({ multiple: false, filters: [ { name: "Images", extensions: ["jpg", "png", "jpeg", "webp", "gif"], }, ], }); if (selected) { console.log(selected); } }; // TODO: implement const clearImage = async () => {}; return ( Image not found { handleSettingsBackgroundValueChange(e.target.name, e.target.value); }} sx={{ width: "100%", }} size="small" type="color" value={stagedSettings.background.background_color} variant="standard" /> } /> ); };