11import './LicenseError.css'
22
3- export function LicenseError ( ) {
3+ export interface LicenseErrorProps {
4+ componentName : string
5+ codeSample : string
6+ }
7+
8+ export function LicenseError ( props : LicenseErrorProps ) {
49 return (
510 < >
611 < div className = "yfiles-react-license-error" >
712 < div className = "yfiles-react-license-error-dialog" >
813 < div className = "yfiles-react-license-error-dialog__title" > Invalid / Missing License</ div >
914 < div className = "yfiles-react-license-error-dialog__content" >
1015 < div className = "yfiles-react-license-error-dialog__paragraph" >
11- The < em > yFiles React Organization Chart Component </ em > requires a valid{ ' ' }
16+ The < em > { props . componentName } </ em > requires a valid{ ' ' }
1217 < a href = "https://www.yworks.com/products/yfiles-for-html" > yFiles for HTML</ a > license.
1318 </ div >
1419 < div className = "yfiles-react-license-error-dialog__paragraph" >
@@ -17,27 +22,12 @@ export function LicenseError() {
1722 </ div >
1823
1924 < div className = "yfiles-react-license-error-dialog__paragraph" >
20- Add the < code > license.json</ code > to your React application and register it like this:
25+ Add the < code > license.json</ code > to your React application and register it before
26+ using the component.
2127 </ div >
2228
2329 < div className = "yfiles-react-license-error-dialog__code-snippet" >
24- < pre >
25- { `import {OrgChart, registerLicense} from '@yworks/react-yfiles-orgchart'
26- import '@yworks/react-yfiles-orgchart/dist/index.css'
27- import yFilesLicense from './license.json'
28-
29- function App() {
30- registerLicense(yFilesLicense)
31-
32- const data = [
33- {id: 0, name: 'Eric Joplin', subordinates: [1, 2]},
34- {id: 1, name: 'Amy Kain'},
35- {id: 2, name: 'David Kerry'}
36- ]
37-
38- return <OrgChart data={data}></OrgChart>
39- }` }
40- </ pre >
30+ < pre > { props . codeSample } </ pre >
4131 </ div >
4232 </ div >
4333 </ div >
0 commit comments