mirror of
https://github.com/iib0011/omni-tools.git
synced 2025-09-26 09:29:30 +02:00
feat: insert csv columns
This commit is contained in:
46
src/components/options/TextareaWithDesc.tsx
Normal file
46
src/components/options/TextareaWithDesc.tsx
Normal file
@@ -0,0 +1,46 @@
|
||||
import { Box, TextField, TextFieldProps } from '@mui/material';
|
||||
import Typography from '@mui/material/Typography';
|
||||
import React from 'react';
|
||||
|
||||
type OwnProps = {
|
||||
description?: string;
|
||||
value: string;
|
||||
onOwnChange: (value: string) => void;
|
||||
placeholder?: string;
|
||||
rows?: number;
|
||||
};
|
||||
|
||||
const TextareaWithDesc = ({
|
||||
description,
|
||||
value,
|
||||
onOwnChange,
|
||||
placeholder,
|
||||
minRows = 3,
|
||||
...props
|
||||
}: TextFieldProps & OwnProps) => {
|
||||
return (
|
||||
<Box>
|
||||
<TextField
|
||||
multiline
|
||||
minRows={minRows}
|
||||
placeholder={placeholder}
|
||||
value={value}
|
||||
onChange={(event) => onOwnChange(event.target.value)}
|
||||
sx={{
|
||||
backgroundColor: 'background.paper',
|
||||
'& .MuiInputBase-root': {
|
||||
overflow: 'hidden' // ✨ Prevent scrollbars
|
||||
}
|
||||
}}
|
||||
{...props}
|
||||
/>
|
||||
{description && (
|
||||
<Typography fontSize={12} mt={1}>
|
||||
{description}
|
||||
</Typography>
|
||||
)}
|
||||
</Box>
|
||||
);
|
||||
};
|
||||
|
||||
export default TextareaWithDesc;
|
Reference in New Issue
Block a user