mirror of
https://github.com/labring/FastGPT.git
synced 2025-08-03 13:38:00 +00:00
Perf input guide (#1557)
* perf: input guide code * perf: input guide ui * Chat input guide api * Update app chat config store * perf: app chat config field * perf: app context * perf: params * fix: ts * perf: filter private config * perf: filter private config * perf: import workflow * perf: limit max tip amount
This commit is contained in:
@@ -3,24 +3,28 @@ import { Flex, Input, InputProps } from '@chakra-ui/react';
|
||||
|
||||
interface Props extends InputProps {
|
||||
leftIcon?: React.ReactNode;
|
||||
rightIcon?: React.ReactNode;
|
||||
}
|
||||
|
||||
const MyInput = ({ leftIcon, ...props }: Props) => {
|
||||
const MyInput = ({ leftIcon, rightIcon, ...props }: Props) => {
|
||||
return (
|
||||
<Flex position={'relative'} alignItems={'center'}>
|
||||
<Input w={'100%'} pl={leftIcon ? '30px !important' : 3} {...props} />
|
||||
<Flex h={'100%'} position={'relative'} alignItems={'center'}>
|
||||
<Input
|
||||
w={'100%'}
|
||||
pl={leftIcon ? '34px !important' : 3}
|
||||
pr={rightIcon ? '34px !important' : 3}
|
||||
{...props}
|
||||
/>
|
||||
{leftIcon && (
|
||||
<Flex
|
||||
alignItems={'center'}
|
||||
position={'absolute'}
|
||||
left={3}
|
||||
w={'20px'}
|
||||
zIndex={10}
|
||||
transform={'translateY(1.5px)'}
|
||||
>
|
||||
<Flex alignItems={'center'} position={'absolute'} left={3} w={'20px'} zIndex={10}>
|
||||
{leftIcon}
|
||||
</Flex>
|
||||
)}
|
||||
{rightIcon && (
|
||||
<Flex alignItems={'center'} position={'absolute'} right={3} w={'20px'} zIndex={10}>
|
||||
{rightIcon}
|
||||
</Flex>
|
||||
)}
|
||||
</Flex>
|
||||
);
|
||||
};
|
||||
|
Reference in New Issue
Block a user