-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add markdown support for custom footer links
- Loading branch information
1 parent
37ae484
commit 7bdf898
Showing
2 changed files
with
24 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,25 @@ | ||
import { Constants } from 'librechat-data-provider'; | ||
import { useGetStartupConfig } from 'librechat-data-provider/react-query'; | ||
import { useLocalize } from '~/hooks'; | ||
import ReactMarkdown from 'react-markdown'; | ||
|
||
export default function Footer() { | ||
const { data: config } = useGetStartupConfig(); | ||
const localize = useLocalize(); | ||
|
||
return ( | ||
<div className="hidden px-3 pb-1 pt-2 text-center text-xs text-black/50 dark:text-white/50 md:block md:px-4 md:pb-4 md:pt-3"> | ||
{typeof config?.customFooter === 'string' ? ( | ||
config.customFooter | ||
) : ( | ||
<> | ||
<a href="https://librechat.ai" target="_blank" rel="noreferrer" className="underline"> | ||
{config?.appTitle || 'LibreChat'} {Constants.VERSION} | ||
</a> | ||
{' - '}. {localize('com_ui_pay_per_call')} | ||
</> | ||
)} | ||
<ReactMarkdown | ||
components={{ | ||
a: ({ ...props }) => <a style={{ textDecoration: 'underline' }} {...props} />, | ||
}} | ||
> | ||
{typeof config?.customFooter === 'string' | ||
? config.customFooter | ||
: `[<${config?.appTitle || 'LibreChat'} ${ | ||
Constants.VERSION | ||
}>](https://librechat.ai) - ${localize('com_ui_pay_per_call')}`} | ||
</ReactMarkdown> | ||
</div> | ||
); | ||
} |