mirror of
https://github.com/iib0011/omni-tools.git
synced 2025-09-19 05:59:34 +02:00
chore: remove TextareaWithDesc.tsx
This commit is contained in:
@@ -1,46 +0,0 @@
|
||||
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;
|
@@ -10,7 +10,6 @@ import { main } from './service';
|
||||
import { getCsvHeaders } from '@utils/csv';
|
||||
import { InitialValuesType } from './types';
|
||||
import TextFieldWithDesc from '@components/options/TextFieldWithDesc';
|
||||
import TextareaWithDesc from '@components/options/TextareaWithDesc';
|
||||
import SelectWithDesc from '@components/options/SelectWithDesc';
|
||||
|
||||
const initialValues: InitialValuesType = {
|
||||
@@ -143,11 +142,13 @@ export default function InsertCsvColumns({
|
||||
title: 'CSV to insert',
|
||||
component: (
|
||||
<Box>
|
||||
<TextareaWithDesc
|
||||
<TextFieldWithDesc
|
||||
multiline
|
||||
rows={3}
|
||||
value={values.csvToInsert}
|
||||
onOwnChange={(val) => updateField('csvToInsert', val)}
|
||||
title="CSV separator"
|
||||
description={`Enter one or more columns you want to insert into the CSV.
|
||||
description={`Enter one or more columns you want to insert into the CSV.
|
||||
the character used to delimit columns has to be the same with the one in the CSV input file.
|
||||
Ps: Blank lines will be ignored`}
|
||||
/>
|
||||
|
Reference in New Issue
Block a user