mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-16 16:30:15 +01:00
* feat: Integrate logger for MessageIcon component * feat: Enhance artifact sharing functionality with updated path checks and read-only state management * feat: Refactor Thinking and Reasoning components for improved structure and styling * feat: Enhance artifact sharing with context value management and responsive layout * feat: Enhance ShareView with theme and language management features * feat: Improve ThinkingButton accessibility and styling for better user interaction * feat: Introduce isArtifactRoute utility for route validation in Artifact components * feat: Add latest message text extraction in SharedView for improved message display * feat: Update locale handling in SharedView for dynamic date formatting * feat: Refactor ArtifactsContext and SharedView for improved context handling and styling adjustments * feat: Enhance artifact panel size management with local storage integration * chore: imports * refactor: move ShareArtifactsContainer out of ShareView --------- Co-authored-by: Danny Avila <danny@librechat.ai>
34 lines
1.4 KiB
TypeScript
34 lines
1.4 KiB
TypeScript
import { useState } from 'react';
|
|
import { Clipboard, CheckMark } from '@librechat/client';
|
|
import type { TMessage, TAttachment, SearchResultData } from 'librechat-data-provider';
|
|
import { useLocalize, useCopyToClipboard } from '~/hooks';
|
|
|
|
type THoverButtons = {
|
|
message: TMessage;
|
|
searchResults?: { [key: string]: SearchResultData };
|
|
};
|
|
|
|
export default function MinimalHoverButtons({ message, searchResults }: THoverButtons) {
|
|
const localize = useLocalize();
|
|
const [isCopied, setIsCopied] = useState(false);
|
|
const copyToClipboard = useCopyToClipboard({
|
|
text: message.text,
|
|
content: message.content,
|
|
searchResults,
|
|
});
|
|
|
|
return (
|
|
<div className="visible mt-1 flex justify-center gap-1 self-end text-gray-400 lg:justify-start">
|
|
<button
|
|
className="ml-0 flex items-center gap-1.5 rounded-lg p-1.5 text-xs text-text-secondary-alt transition-colors duration-200 hover:bg-surface-hover hover:text-text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-black dark:focus-visible:ring-white md:opacity-0 md:group-focus-within:opacity-100 md:group-hover:opacity-100"
|
|
onClick={() => copyToClipboard(setIsCopied)}
|
|
type="button"
|
|
title={
|
|
isCopied ? localize('com_ui_copied_to_clipboard') : localize('com_ui_copy_to_clipboard')
|
|
}
|
|
>
|
|
{isCopied ? <CheckMark className="h-[18px] w-[18px]" /> : <Clipboard size="19" />}
|
|
</button>
|
|
</div>
|
|
);
|
|
}
|