mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-01-05 01:59:01 +08:00
Refactored the OneBot API debug interface for a more modern, tabbed layout with improved sidebar navigation, request/response panels, and better mobile support. Enhanced code editor, response display, and message construction modal. Updated system info and status display for cleaner visuals. Improved xterm font sizing and rendering logic for mobile. WebSocket debug page now features a unified header, status bar, and clearer connection controls. Overall, this commit provides a more user-friendly and visually consistent debugging experience.
63 lines
1.4 KiB
TypeScript
63 lines
1.4 KiB
TypeScript
import { Button } from '@heroui/button';
|
|
import {
|
|
Modal,
|
|
ModalBody,
|
|
ModalContent,
|
|
ModalFooter,
|
|
ModalHeader,
|
|
useDisclosure,
|
|
} from '@heroui/modal';
|
|
|
|
import ChatInput from '.';
|
|
|
|
interface ChatInputModalProps {
|
|
children?: (onOpen: () => void) => React.ReactNode;
|
|
}
|
|
|
|
export default function ChatInputModal ({ children }: ChatInputModalProps) {
|
|
const { isOpen, onOpen, onOpenChange } = useDisclosure();
|
|
|
|
return (
|
|
<>
|
|
{children ? children(onOpen) : (
|
|
<Button
|
|
onPress={onOpen}
|
|
color='primary'
|
|
radius='full'
|
|
variant='flat'
|
|
size='sm'
|
|
className="bg-primary/10 text-primary"
|
|
>
|
|
构造消息
|
|
</Button>
|
|
)}
|
|
<Modal
|
|
size='4xl'
|
|
scrollBehavior='inside'
|
|
isOpen={isOpen}
|
|
onOpenChange={onOpenChange}
|
|
>
|
|
<ModalContent>
|
|
{(onClose) => (
|
|
<>
|
|
<ModalHeader className='flex flex-col gap-1'>
|
|
构造消息
|
|
</ModalHeader>
|
|
<ModalBody className='overflow-y-auto'>
|
|
<div className='overflow-y-auto'>
|
|
<ChatInput />
|
|
</div>
|
|
</ModalBody>
|
|
<ModalFooter>
|
|
<Button color='primary' onPress={onClose} variant='flat'>
|
|
关闭
|
|
</Button>
|
|
</ModalFooter>
|
|
</>
|
|
)}
|
|
</ModalContent>
|
|
</Modal>
|
|
</>
|
|
);
|
|
}
|