This commit is contained in:
Cledwyn Lew
2025-12-25 15:10:20 +08:00
parent 8f084dc75d
commit a41bf16972
16 changed files with 606 additions and 849 deletions

View File

@@ -1,5 +1,6 @@
import { cn } from '@heroui/react';
import { useEffect, useRef, useState } from 'react';
import { mjChatCls } from '@/utils/cls';
export type MessageEditAreaProps = {
isUser: boolean;
@@ -39,16 +40,22 @@ export const MessageEditArea = ({
return (
<div
className="w-full"
className={mjChatCls(['msg-edit-textarea-wrapper'], 'w-full')}
style={{
height: wrapHeight,
}}
>
<textarea
ref={textareaRef}
className={cn(
'w-full outline-none resize-none h-fit overflow-hidden p-4 bg-background rounded-xl text-[16px]',
isUser ? 'rounded-br-sm' : 'rounded-bl-sm',
className={mjChatCls(
[
'msg-edit-textarea',
isUser ? 'msg-edit-textarea-user' : 'msg-edit-textarea-assistant',
],
cn(
'w-full outline-none resize-none h-fit overflow-hidden p-4 bg-background rounded-xl text-[16px]',
isUser ? 'rounded-br-sm' : 'rounded-bl-sm',
),
)}
value={editedMessage}
onChange={(e) => {