mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-01-04 01:28:51 +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
|
|
@ -12,6 +12,7 @@ const ClearConvos = ({ open, onOpenChange }) => {
|
|||
const [confirmClear, setConfirmClear] = useState(false);
|
||||
const localize = useLocalize();
|
||||
|
||||
// Clear all conversations
|
||||
const clearConvos = useCallback(() => {
|
||||
if (confirmClear) {
|
||||
console.log('Clearing conversations...');
|
||||
|
|
@ -22,6 +23,7 @@ const ClearConvos = ({ open, onOpenChange }) => {
|
|||
}
|
||||
}, [confirmClear, clearConvosMutation]);
|
||||
|
||||
// Refresh conversations after clearing
|
||||
useEffect(() => {
|
||||
if (clearConvosMutation.isSuccess) {
|
||||
refreshConversations();
|
||||
|
|
|
|||
|
|
@ -1,25 +0,0 @@
|
|||
import { forwardRef } from 'react';
|
||||
import { cn } from '~/utils/';
|
||||
|
||||
const NavLink = forwardRef((props, ref) => {
|
||||
const { svg, text, clickHandler, className = '' } = props;
|
||||
const defaultProps = {};
|
||||
|
||||
defaultProps.className = cn(
|
||||
'flex cursor-pointer items-center gap-3 rounded-md py-3 px-3 text-sm text-white transition-colors duration-200 hover:bg-gray-500/10',
|
||||
className,
|
||||
);
|
||||
|
||||
if (clickHandler) {
|
||||
defaultProps.onClick = clickHandler;
|
||||
}
|
||||
|
||||
return (
|
||||
<a {...defaultProps} ref={ref}>
|
||||
{svg()}
|
||||
{text}
|
||||
</a>
|
||||
);
|
||||
});
|
||||
|
||||
export default NavLink;
|
||||
35
client/src/components/Nav/NavLink.tsx
Normal file
35
client/src/components/Nav/NavLink.tsx
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
import { FC, forwardRef } from 'react';
|
||||
import { cn } from '~/utils/';
|
||||
|
||||
interface Props {
|
||||
svg: () => JSX.Element;
|
||||
text: string;
|
||||
clickHandler?: () => void;
|
||||
className?: string;
|
||||
}
|
||||
|
||||
const NavLink: FC<Props> = forwardRef<HTMLAnchorElement, Props>((props, ref) => {
|
||||
const { svg, text, clickHandler, className = '' } = props;
|
||||
const defaultProps: {
|
||||
className: string;
|
||||
onClick?: () => void;
|
||||
} = {
|
||||
className: cn(
|
||||
'flex cursor-pointer items-center gap-3 rounded-md py-3 px-3 text-sm text-white transition-colors duration-200 hover:bg-gray-500/10',
|
||||
className,
|
||||
),
|
||||
};
|
||||
|
||||
if (clickHandler) {
|
||||
defaultProps.onClick = clickHandler;
|
||||
}
|
||||
|
||||
return (
|
||||
<a {...defaultProps} ref={ref}>
|
||||
{svg()}
|
||||
{text}
|
||||
</a>
|
||||
);
|
||||
});
|
||||
|
||||
export default NavLink;
|
||||
Loading…
Add table
Add a link
Reference in a new issue