mirror of
https://github.com/labring/FastGPT.git
synced 2025-08-02 20:58:12 +00:00
v4.5.1 (#417)
This commit is contained in:
@@ -1,12 +1,14 @@
|
||||
import React, { useCallback, useRef } from 'react';
|
||||
import { ModalFooter, ModalBody, Input, useDisclosure, Button } from '@chakra-ui/react';
|
||||
import { ModalFooter, ModalBody, Input, useDisclosure, Button, Box } from '@chakra-ui/react';
|
||||
import MyModal from '@/components/MyModal';
|
||||
|
||||
export const useEditTitle = ({
|
||||
title,
|
||||
tip,
|
||||
placeholder = ''
|
||||
}: {
|
||||
title: string;
|
||||
tip?: string;
|
||||
placeholder?: string;
|
||||
}) => {
|
||||
const { isOpen, onOpen, onClose } = useDisclosure();
|
||||
@@ -51,6 +53,12 @@ export const useEditTitle = ({
|
||||
() => (
|
||||
<MyModal isOpen={isOpen} onClose={onClose} title={title}>
|
||||
<ModalBody>
|
||||
{!!tip && (
|
||||
<Box mb={2} color={'myGray.500'} fontSize={'sm'}>
|
||||
{tip}
|
||||
</Box>
|
||||
)}
|
||||
|
||||
<Input
|
||||
ref={inputRef}
|
||||
defaultValue={defaultValue.current}
|
||||
@@ -67,7 +75,7 @@ export const useEditTitle = ({
|
||||
</ModalFooter>
|
||||
</MyModal>
|
||||
),
|
||||
[isOpen, onClose, onclickConfirm, placeholder, title]
|
||||
[isOpen, onClose, onclickConfirm, placeholder, tip, title]
|
||||
);
|
||||
|
||||
return {
|
||||
|
Reference in New Issue
Block a user