Lint Code

This commit is contained in:
mickr777 2023-07-26 18:35:04 +10:00 committed by GitHub
parent de73e4f5b9
commit 2d0f932737
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,3 +1,4 @@
import { memo, ChangeEvent } from 'react';
import { Textarea, Input } from '@chakra-ui/react'; import { Textarea, Input } from '@chakra-ui/react';
import { useAppDispatch } from 'app/store/storeHooks'; import { useAppDispatch } from 'app/store/storeHooks';
import { fieldValueChanged } from 'features/nodes/store/nodesSlice'; import { fieldValueChanged } from 'features/nodes/store/nodesSlice';
@ -5,9 +6,10 @@ import {
StringInputFieldTemplate, StringInputFieldTemplate,
StringInputFieldValue, StringInputFieldValue,
} from 'features/nodes/types/types'; } from 'features/nodes/types/types';
import { ChangeEvent, memo } from 'react';
import { FieldComponentProps } from './types'; import { FieldComponentProps } from './types';
const FIELD_PADDING = 20;
const StringInputFieldComponent = ( const StringInputFieldComponent = (
props: FieldComponentProps< props: FieldComponentProps<
StringInputFieldValue, StringInputFieldValue,
@ -31,12 +33,13 @@ const StringInputFieldComponent = (
); );
}; };
const textareaWidth = nodeWidth - 20; const textareaWidth = nodeWidth - FIELD_PADDING;
const textareaFieldNames = ['prompt', 'text'];
return ( return (
<> <>
{field.name.toLowerCase() === 'prompt' || {textareaFieldNames.includes(field.name.toLowerCase()) ? (
field.name.toLowerCase() === 'text' ? (
<Textarea <Textarea
style={{ style={{
height: '150px', height: '150px',