-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: make doc preview as composable
- Loading branch information
Shibani Basava
authored and
Shibani Basava
committed
Feb 12, 2024
1 parent
761b56a
commit 89ce27c
Showing
4 changed files
with
33 additions
and
7 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
12 changes: 12 additions & 0 deletions
12
packages/chat-component/src/components/citation-previewer.ts
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { injectable } from 'inversify'; | ||
import { container, type CitationActionComponent, ComponentType } from './composable.js'; | ||
import { html } from 'lit'; | ||
|
||
@injectable() | ||
export class CitationPreviewer implements CitationActionComponent { | ||
render(citation: Citation, url: string) { | ||
return html`<document-previewer url="${url}"></document-previewer>`; | ||
} | ||
} | ||
|
||
container.bind<CitationActionComponent>(ComponentType.CitationActionComponent).to(CitationPreviewer); |
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