@@ -12,22 +12,29 @@ export default {
1212 } ,
1313} ;
1414
15- const Template = ( { ... args } ) => < PrismCode { ...args } /> ;
15+ const Template = ( args : any ) => < PrismCode { ...args } /> ;
1616
17- export const OneLine = Template . bind ( { } ) ;
18- OneLine . args = {
19- code : '$ npm install -g cubejs-cli' ,
17+ export const OneLine = {
18+ render : Template ,
19+ args : {
20+ language : 'bash' ,
21+ code : '$ npm install -g cubejs-cli' ,
22+ } ,
2023} ;
2124
22- export const MultiLine = Template . bind ( { } ) ;
23- MultiLine . args = {
24- code : '$ npm install -g cubejs-cli\n$ cubejs deploy' ,
25+ export const MultiLine = {
26+ render : Template ,
27+ args : {
28+ language : 'bash' ,
29+ code : '$ npm install -g cubejs-cli\n$ cubejs deploy' ,
30+ } ,
2531} ;
2632
27- export const JavascriptSyntax = Template . bind ( { } ) ;
28- JavascriptSyntax . args = {
29- language : 'javascript' ,
30- code : `cube('LineItems', {
33+ export const JavascriptSyntax = {
34+ render : Template ,
35+ args : {
36+ language : 'javascript' ,
37+ code : `cube('LineItems', {
3138 sql: \`SELECT * FROM public.line_items\`,
3239
3340
@@ -73,12 +80,14 @@ JavascriptSyntax.args = {
7380 }
7481 }
7582});` ,
83+ } ,
7684} ;
7785
78- export const YamlSyntax = Template . bind ( { } ) ;
79- YamlSyntax . args = {
80- language : 'yaml' ,
81- code : `cubes:
86+ export const YamlSyntax = {
87+ render : Template ,
88+ args : {
89+ language : 'yaml' ,
90+ code : `cubes:
8291 # Define the Orders cube
8392 - name: Orders
8493 sql: SELECT * FROM public.orders
@@ -136,12 +145,14 @@ YamlSyntax.args = {
136145 - cube: Orders
137146 sql: \${Customers.id} = \${Orders.customer_id}
138147 relationship: one_to_many # One customer can have many orders` ,
148+ } ,
139149} ;
140150
141- export const SqlSyntax = Template . bind ( { } ) ;
142- SqlSyntax . args = {
143- language : 'sql' ,
144- code : `WITH RecursiveCTE AS (
151+ export const SqlSyntax = {
152+ render : Template ,
153+ args : {
154+ language : 'sql' ,
155+ code : `WITH RecursiveCTE AS (
145156 -- Recursive CTE to generate a sequence of numbers
146157 SELECT 1 AS Level, CAST('2025-01-01' AS DATE) AS GeneratedDate
147158 UNION ALL
@@ -184,7 +195,7 @@ FinalOutput AS (
184195 CROSS JOIN RecursiveCTE r
185196 WHERE r.GeneratedDate <= GETDATE()
186197)
187- -- Final query to output the results
198+ -- Final query to output the results
188199SELECT
189200 fo.UserID,
190201 fo.UserName,
@@ -194,13 +205,16 @@ SELECT
194205 fo.GeneratedDate
195206FROM FinalOutput fo
196207ORDER BY fo.GeneratedDate, fo.UserID;` ,
208+ } ,
197209} ;
198210
199- export const DiffSyntax = Template . bind ( { } ) ;
200- DiffSyntax . args = {
201- language : 'javascript' ,
202- code : ` console.log('Hello, world!');
211+ export const DiffSyntax = {
212+ render : Template ,
213+ args : {
214+ language : 'javascript' ,
215+ code : ` console.log('Hello, world!');
203216+ console.log('This line was added!');
204217 console.log('Another unchanged line');
205218- console.log('This line was removed.');` ,
219+ } ,
206220} ;
0 commit comments