mirror of
https://github.com/iib0011/omni-tools.git
synced 2025-12-29 16:16:02 +00:00
refactor: tool options components
This commit is contained in:
31
src/components/options/TextFieldWithDesc.tsx
Normal file
31
src/components/options/TextFieldWithDesc.tsx
Normal file
@@ -0,0 +1,31 @@
|
||||
import { Box, TextField } from '@mui/material';
|
||||
import Typography from '@mui/material/Typography';
|
||||
import React from 'react';
|
||||
|
||||
const TextFieldWithDesc = ({
|
||||
description,
|
||||
value,
|
||||
onChange,
|
||||
placeholder
|
||||
}: {
|
||||
description: string;
|
||||
value: string;
|
||||
onChange: (value: string) => void;
|
||||
placeholder?: string;
|
||||
}) => {
|
||||
return (
|
||||
<Box>
|
||||
<TextField
|
||||
placeholder={placeholder}
|
||||
sx={{ backgroundColor: 'white' }}
|
||||
value={value}
|
||||
onChange={(event) => onChange(event.target.value)}
|
||||
/>
|
||||
<Typography fontSize={12} mt={1}>
|
||||
{description}
|
||||
</Typography>
|
||||
</Box>
|
||||
);
|
||||
};
|
||||
|
||||
export default TextFieldWithDesc;
|
||||
Reference in New Issue
Block a user