mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-20 10:20:15 +01:00
style: adjust icon scale, favicon, azure icon; chore: convert files to TSX; ci: unit tests for generation buttons (#987)
* some jsx to tsx and added 3 new test * test(stop) * new librechat and azure icon, small fix * fix(tsc error) * fix(tsc error) Endpoint Item
This commit is contained in:
parent
3137f467a8
commit
be71a1947b
21 changed files with 187 additions and 56 deletions
|
|
@ -22,7 +22,7 @@ export default function DeleteButton({ conversationId, renaming, retainView, tit
|
|||
|
||||
useEffect(() => {
|
||||
if (deleteConvoMutation.isSuccess) {
|
||||
if (currentConversation?.conversationId == conversationId) {
|
||||
if ((currentConversation as { conversationId?: string }).conversationId == conversationId) {
|
||||
newConversation();
|
||||
}
|
||||
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
import React from 'react';
|
||||
import RenameIcon from '../svg/RenameIcon';
|
||||
import CheckMark from '../svg/CheckMark';
|
||||
|
||||
export default function RenameButton({ renaming, renameHandler, onRename, twcss }) {
|
||||
const handler = renaming ? onRename : renameHandler;
|
||||
const classProp = { className: 'p-1 hover:text-white' };
|
||||
if (twcss) {
|
||||
classProp.className = twcss;
|
||||
}
|
||||
return (
|
||||
<button {...classProp} onClick={handler}>
|
||||
{renaming ? <CheckMark /> : <RenameIcon />}
|
||||
</button>
|
||||
);
|
||||
}
|
||||
28
client/src/components/Conversations/RenameButton.tsx
Normal file
28
client/src/components/Conversations/RenameButton.tsx
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
import React, { ReactElement } from 'react';
|
||||
import RenameIcon from '../svg/RenameIcon';
|
||||
import CheckMark from '../svg/CheckMark';
|
||||
|
||||
interface RenameButtonProps {
|
||||
renaming: boolean;
|
||||
renameHandler: () => void;
|
||||
onRename: () => void;
|
||||
twcss?: string;
|
||||
}
|
||||
|
||||
export default function RenameButton({
|
||||
renaming,
|
||||
renameHandler,
|
||||
onRename,
|
||||
twcss,
|
||||
}: RenameButtonProps): ReactElement {
|
||||
const handler = renaming ? onRename : renameHandler;
|
||||
const classProp: { className?: string } = { className: 'p-1 hover:text-white' };
|
||||
if (twcss) {
|
||||
classProp.className = twcss;
|
||||
}
|
||||
return (
|
||||
<button {...classProp} onClick={handler}>
|
||||
{renaming ? <CheckMark /> : <RenameIcon />}
|
||||
</button>
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue