@@ -0,0 +1,7 @@ +.modalContainer { + min-width: 300px; + min-height: 200px; + background: var(--background-color-additional); + border-radius: 15px; + padding: 15px; +} \ No newline at end of file @@ -9,11 +9,11 @@ export const useLibrarySwiper = (onSlideFalse: ((...args: any) => any) | undefin const keydown = (e: KeyboardEvent) => { if (e.key === 'ArrowRight') { - e.preventDefault() + // e.preventDefault() slideNext() } if (e.key === 'ArrowLeft') { - e.preventDefault() + // e.preventDefault() slidePrev() } } @@ -0,0 +1 @@ +export * from './model-input' \ No newline at end of file @@ -0,0 +1,62 @@ +.wrapper { + display: flex; + align-items: center; + padding: 14px 14px; + width: 100%; + border-radius: 15px; + gap: 10px; +} + +:root[data-theme='light'] { + .wrapper { + border: 2px solid #e1e1e1; + } + .divider { + background-color: #EBEFF5; + } +} + +:root[data-theme='dark'] { + .wrapper { + border: 2px solid rgb(66, 66, 72) !important; + } + .divider { + background-color: #40404E; + } +} + +.area { + width: 100%; + resize: none; + // height: 28px; + border-radius: 0px; + overflow-y: hidden; + padding: 0px; + font-size: 16px; + max-height: 82px; + + &::placeholder{ + font-size: 16px; + } + + border: none; + outline: none; + &:focus { + outline: none; + } +} + +.endAdornment { + display: flex; + align-items: center; +} + +.divider { + height: 20px; + width: 1px; + margin: 0px 8px; +} + +// theme === 'dark' + // ? '#40404E' + // : '#EBEFF5', \ No newline at end of file @@ -11,6 +11,8 @@ import { IModelInputs } from '#/shared/api/models/models' import { styleInputWithoutBorderFocus } from '#/shared/ui/input' import { useThemeAndDevice } from '#/shared/lib/hooks' +import classes from './model-input.module.scss' + interface Input { loading: boolean // requestImage: () => void @@ -33,7 +35,7 @@ interface Input { resendValue?: string } -export const UniqInput: FC = ({ +export const ModelInput: FC = ({ image, loading, unpinImage, @@ -55,11 +57,6 @@ export const UniqInput: FC = ({ const [value, setValue] = React.useState('') useEffect(() => { - console.log(loading) - }, [loading]) - // const [disableOnChange, setDisableOnChange] = React.useState(false) - - React.useEffect(() => { if (input_types) { setRequired(input_types.map((el) => (el.required ? el.type : null))) setTypes(input_types.map((el) => el.type)) @@ -67,7 +64,7 @@ export const UniqInput: FC = ({ } }, [input_types]) - React.useEffect(() => { + useEffect(() => { if (input_types && typeVersions && !typeVersions['text']) { setDisabled(true) } else if ( @@ -78,167 +75,94 @@ export const UniqInput: FC = ({ } }, [typeVersions]) - React.useEffect(() => { + useEffect(() => { if (resendValue) { setValue(resendValue) } }, [resendValue]) - // const handlePaste = (event:ClipboardEvent) => { - // setDisableOnChange(true); - // // const pastedData = ` \n \`\`\`text \n ${event.clipboardData.getData('Text')} \n \`\`\``; - // const pastedData = event.clipboardData.getData('Text') - // setValue(value + pastedData) - // // Включаем onChange обратно после обработки вставки - // setTimeout(() => setDisableOnChange(false), 0); - // }; - return ( - { - if (e.shiftKey && e.key === 'Enter') { - } else if (e.key === 'Enter') { - e.preventDefault() - const isSend = sendMessage(value, required) - if (isSend) { - setValue('') - if (unpinImage) unpinImage() + > + {!desktop && ( + + + + )} + + +
+ {typeVersions['image'] && + (typeVersions['image'].length === 0 || + typeVersions['image'].includes(currentVersion)) && ( + <> + {!blocked && ( + )} - - - ), - startAdornment: !desktop && ( - - - - - - ), - }} - /> +
+ + )} + {!disabled && !blocked && ( + + )} +
+ ) } @@ -0,0 +1 @@ +export * from './ui' \ No newline at end of file @@ -27,6 +27,7 @@ import { Device, DeviceOs } from '#/shared/lib/types/entities' import { ArrowDownScroll } from '#/shared/ui/icon-components/scroll-down-arrow' import { SvgIcon } from '#/shared/ui/svg' import { ImageMessagesList,useImagesPagination } from '#/widgets/messages' +import { ModelInput } from '#/features/model-input' const ImageModelPage: NextPageWithLayout = () => { const { query } = useRouter() @@ -154,7 +155,7 @@ const ImageModelPage: NextPageWithLayout = () => { }} > {botParams && ( - { sx={{ position: 'relative', zIndex: 10 }} > {botParams && ( - ({ />
-