mirror of
https://github.com/multica-ai/multica.git
synced 2026-07-16 06:39:01 +02:00
- Replace plain textarea in chat-input with ContentEditor (rich text, matches comment-input structure) - Extract shared SubmitButton component (idle/loading/running states) to packages/ui/components/common - Update comment-input to use icon-sm size - Fix chat-fab Tooltip delay prop (not supported on Root, global 500ms applies) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
35 lines
780 B
TypeScript
35 lines
780 B
TypeScript
"use client";
|
|
|
|
import { ArrowUp, Loader2, Square } from "lucide-react";
|
|
import { Button } from "@multica/ui/components/ui/button";
|
|
|
|
interface SubmitButtonProps {
|
|
onClick: () => void;
|
|
disabled?: boolean;
|
|
loading?: boolean;
|
|
running?: boolean;
|
|
onStop?: () => void;
|
|
}
|
|
|
|
function SubmitButton({ onClick, disabled, loading, running, onStop }: SubmitButtonProps) {
|
|
if (running) {
|
|
return (
|
|
<Button size="icon-sm" onClick={onStop}>
|
|
<Square className="fill-current" />
|
|
</Button>
|
|
);
|
|
}
|
|
|
|
return (
|
|
<Button size="icon-sm" disabled={disabled || loading} onClick={onClick}>
|
|
{loading ? (
|
|
<Loader2 className="animate-spin" />
|
|
) : (
|
|
<ArrowUp />
|
|
)}
|
|
</Button>
|
|
);
|
|
}
|
|
|
|
export { SubmitButton, type SubmitButtonProps };
|