Skip to content

Commit

Permalink
update var naming
Browse files Browse the repository at this point in the history
  • Loading branch information
andrii-i committed Jan 5, 2024
1 parent d8c3d9d commit 4407b8f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/jupyter-ai/src/components/chat-messages.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ export function ChatMessages(props: ChatMessagesProps): JSX.Element {
/>
<MarkdownComponent
rmRegistry={props.rmRegistry}
markdownString={message.body}
markdownStr={message.body}
/>
</Box>
))}
Expand Down
12 changes: 6 additions & 6 deletions packages/jupyter-ai/src/components/markdown-component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,30 @@ import { Widget } from '@lumino/widgets';
import { LuminoComponent } from './lumino-component';

type MarkdownWidgetProps = {
markdownString: string;
markdownStr: string;
rmRegistry: IRenderMimeRegistry;
};

type MarkdownComponentProps = {
markdownString: string;
markdownStr: string;
rmRegistry: IRenderMimeRegistry;
};

class MarkdownWidget extends Widget {
private rmRegistry: IRenderMimeRegistry;
private markdownString: string;
private markdownStr: string;

constructor(props: MarkdownWidgetProps) {
super();
this.rmRegistry = props.rmRegistry;
this.markdownString = props.markdownString;
this.markdownStr = props.markdownStr;
this.initializeMarkdownRendering();
}

async initializeMarkdownRendering(): Promise<void> {
const mimeType = 'text/markdown';
const model = this.rmRegistry.createModel({
data: { [mimeType]: this.markdownString }
data: { [mimeType]: this.markdownStr }
});
const renderer = this.rmRegistry.createRenderer(mimeType);
await renderer.renderModel(model);
Expand All @@ -43,7 +43,7 @@ export function MarkdownComponent(
useEffect(() => {
if (!widgetRef.current) {
widgetRef.current = new MarkdownWidget({
markdownString: props.markdownString,
markdownStr: props.markdownStr,
rmRegistry: props.rmRegistry
});
}
Expand Down

0 comments on commit 4407b8f

Please sign in to comment.