Skip to content

Commit

Permalink
format:fix
Browse files Browse the repository at this point in the history
  • Loading branch information
IlyaBondar committed Dec 20, 2024
1 parent 6df2fcb commit e0cfba6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions apps/chat/src/components/Markdown/CodeBlock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import classNames from 'classnames';

import {
languageExtensionMapping,
languageNameMapping,
languageFilenameMapping,
languageNameMapping,
} from '@/src/utils/app/codeblock';

import { Translation } from '@/src/types/translation';
Expand Down Expand Up @@ -67,7 +67,9 @@ export const CodeBlock: FC<Props> = memo(
// languageExtensionMapping allows set empty extension
const fileExtension = languageExtensionMapping[displayLanguage] ?? '.txt';
// use the specific filename if it exists in languageFilenameMapping
const suggestedFileName = languageFilenameMapping[displayLanguage] ?? `ai-chat-code-${currentDate()}${fileExtension}`;
const suggestedFileName =
languageFilenameMapping[displayLanguage] ??
`ai-chat-code-${currentDate()}${fileExtension}`;
const fileName = window.prompt(
t('Enter file name') || '',
suggestedFileName,
Expand Down
2 changes: 1 addition & 1 deletion apps/chat/src/utils/app/codeblock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,4 +245,4 @@ export const languageFilenameMapping: languageMap = {
dockerfile: 'Dockerfile',
makefile: 'Makefile',
// Add other specific filenames here
};
};

0 comments on commit e0cfba6

Please sign in to comment.