forked from nrkno/sofie-core
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: reimplement script hover preview
- Loading branch information
1 parent
bfc7122
commit fd23e9c
Showing
7 changed files
with
325 additions
and
230 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
25 changes: 25 additions & 0 deletions
25
packages/webui/src/client/ui/PreviewPopUp/PreviewPopUpContent.tsx
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,25 @@ | ||
import React from 'react' | ||
import { PreviewContent } from './PreviewPopUpContext' | ||
|
||
interface PreviewPopUpContentProps { | ||
content: PreviewContent | ||
} | ||
|
||
export function PreviewPopUpContent({ content }: PreviewPopUpContentProps): React.ReactElement { | ||
switch (content.type) { | ||
case 'text': | ||
return <ScriptPreviewElement content={content} /> | ||
default: | ||
return <></> | ||
} | ||
} | ||
|
||
interface ScriptPreviewProps { | ||
content: { | ||
type: 'text' | ||
content: string | ||
} | ||
} | ||
export function ScriptPreviewElement({ content }: ScriptPreviewProps): React.ReactElement { | ||
return <div className="script">{content.content}</div> | ||
} |
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
Oops, something went wrong.