Skip to content

Commit

Permalink
💄 style(ui): fixed incorrect text display on connect check (lobehub#2994
Browse files Browse the repository at this point in the history
)

* 🐛 fix(ui): Fixed incorrect text display on connect check

* 🐛 fix(ui): Fixed incorrect text display on connect check
  • Loading branch information
RubuJam authored Jun 24, 2024
1 parent f40292e commit 5160f23
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/app/(main)/settings/llm/components/Checker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { Flexbox } from 'react-layout-kit';

import { TraceNameMap } from '@/const/trace';
import { useIsMobile } from '@/hooks/useIsMobile';
import { useProviderName } from '@/hooks/useProviderName';
import { chatService } from '@/services/chat';
import { ChatMessageError } from '@/types/message';

Expand All @@ -20,6 +21,7 @@ interface ConnectionCheckerProps {

const Error = memo<{ error: ChatMessageError }>(({ error }) => {
const { t } = useTranslation('error');
const providerName = useProviderName(error.body?.provider);

return (
<Flexbox gap={8} style={{ maxWidth: '600px', width: '100%' }}>
Expand All @@ -32,7 +34,7 @@ const Error = memo<{ error: ChatMessageError }>(({ error }) => {
</Highlighter>
</Flexbox>
}
message={t(`response.${error.type}` as any)}
message={t(`response.${error.type}` as any, { provider: providerName })}
showIcon
type={'error'}
/>
Expand Down

0 comments on commit 5160f23

Please sign in to comment.