diff --git a/client/src/components/Chat/Footer.tsx b/client/src/components/Chat/Footer.tsx index cca7d9a7cf..0e62eb195d 100644 --- a/client/src/components/Chat/Footer.tsx +++ b/client/src/components/Chat/Footer.tsx @@ -1,4 +1,5 @@ import React from 'react'; +import ReactMarkdown from 'react-markdown'; import { Constants } from 'librechat-data-provider'; import { useGetStartupConfig } from 'librechat-data-provider/react-query'; import { useLocalize } from '~/hooks'; @@ -32,22 +33,40 @@ export default function Footer({ className }: { className?: string }) { ); - const mainContentRender = ( - - {typeof config?.customFooter === 'string' ? ( - config.customFooter - ) : ( - <> - - {config?.appTitle || 'LibreChat'} {Constants.VERSION} - - {' - '} {localize('com_ui_new_footer')} - - )} - - ); + const mainContentParts = ( + typeof config?.customFooter === 'string' + ? config.customFooter + : '[](https://librechat.ai) - ' + + localize('com_ui_pay_per_call') + ).split('|'); - const footerElements = [mainContentRender, privacyPolicyRender, termsOfServiceRender].filter( + const mainContentRender = mainContentParts.map((text, index) => ( + + { + const { ['node']: _, href, ...otherProps } = props; + return ( + + ); + }, + p: ({ node, ...props }) => , + }} + > + {text.trim()} + + + )); + + const footerElements = [...mainContentRender, privacyPolicyRender, termsOfServiceRender].filter( Boolean, ); @@ -55,7 +74,7 @@ export default function Footer({ className }: { className?: string }) {
{footerElements.map((contentRender, index) => { diff --git a/client/src/components/Input/Footer.tsx b/client/src/components/Input/Footer.tsx deleted file mode 100644 index c5fabecc66..0000000000 --- a/client/src/components/Input/Footer.tsx +++ /dev/null @@ -1,23 +0,0 @@ -import { Constants } from 'librechat-data-provider'; -import { useGetStartupConfig } from 'librechat-data-provider/react-query'; -import { useLocalize } from '~/hooks'; - -export default function Footer() { - const { data: config } = useGetStartupConfig(); - const localize = useLocalize(); - - return ( -
- {typeof config?.customFooter === 'string' ? ( - config.customFooter - ) : ( - <> - - {config?.appTitle || 'LibreChat'} {Constants.VERSION} - - {' - '}. {localize('com_ui_pay_per_call')} - - )} -
- ); -}