mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-20 13:54:36 +01:00
Cleanup UI and prompt
This commit is contained in:
@@ -19,6 +19,7 @@ type MessageBubbleProps = {
|
||||
content: string;
|
||||
messageIndex?: number;
|
||||
onEditSubmit?: (messageIndex: number, newContent: string) => void;
|
||||
isComplete?: boolean;
|
||||
};
|
||||
|
||||
export function MessageBubble({
|
||||
@@ -26,6 +27,7 @@ export function MessageBubble({
|
||||
content,
|
||||
messageIndex = 0,
|
||||
onEditSubmit,
|
||||
isComplete = true,
|
||||
}: MessageBubbleProps) {
|
||||
const { t } = useTranslation(["views/chat", "common"]);
|
||||
const isUser = role === "user";
|
||||
@@ -152,21 +154,25 @@ export function MessageBubble({
|
||||
</TooltipContent>
|
||||
</Tooltip>
|
||||
)}
|
||||
<Tooltip>
|
||||
<TooltipTrigger asChild>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
className="size-7 text-muted-foreground hover:text-foreground"
|
||||
onClick={handleCopy}
|
||||
disabled={!content?.trim()}
|
||||
aria-label={t("button.copy", { ns: "common" })}
|
||||
>
|
||||
<FaCopy className="size-3" />
|
||||
</Button>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent>{t("button.copy", { ns: "common" })}</TooltipContent>
|
||||
</Tooltip>
|
||||
{isComplete && (
|
||||
<Tooltip>
|
||||
<TooltipTrigger asChild>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
className="size-7 text-muted-foreground hover:text-foreground"
|
||||
onClick={handleCopy}
|
||||
disabled={!content?.trim()}
|
||||
aria-label={t("button.copy", { ns: "common" })}
|
||||
>
|
||||
<FaCopy className="size-3" />
|
||||
</Button>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent>
|
||||
{t("button.copy", { ns: "common" })}
|
||||
</TooltipContent>
|
||||
</Tooltip>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -104,6 +104,9 @@ export default function ChatPage() {
|
||||
onEditSubmit={
|
||||
msg.role === "user" ? handleEditSubmit : undefined
|
||||
}
|
||||
isComplete={
|
||||
msg.role === "user" || !isLoading || i < messages.length - 1
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
))}
|
||||
|
||||
Reference in New Issue
Block a user