1
1
import type { Meta , StoryFn } from "@storybook/react" ;
2
-
3
2
import PyScriptProvider from "~root/source/library/components/py-script-provider/py-script-provider" ;
4
-
5
3
import PyConfig from "./py-config" ;
6
-
7
4
import type { PyConfigProperties , PyConfigTag } from "./py-config.types" ;
8
5
9
6
export default {
10
7
component : PyConfig ,
11
8
} as Meta < typeof PyConfig > ;
12
9
10
+ const pythonTestFile : string = "./test_file.py" ;
11
+
13
12
const Template : StoryFn < PyConfigTag > = < T extends object > ( {
14
13
...rest
15
14
} : PyConfigProperties < T > ) : JSX . Element => {
@@ -26,25 +25,27 @@ PyConfigExample.args = {
26
25
type : "json" ,
27
26
packages : new Set ( [ "matplotlib" , "numpy" , "folium" ] ) ,
28
27
plugins : new Set ( [ "https://pyscript.net/latest/plugins/python/py_tutor.py" ] ) ,
29
- fetch : {
30
- files : new Set ( [ "./test_file.py" ] ) ,
31
- } ,
28
+ fetch : [
29
+ {
30
+ files : new Set ( [ pythonTestFile ] ) ,
31
+ } ,
32
+ ] ,
32
33
} ;
33
34
34
35
export const PyConfigExternalJsonConfigExample : StoryFn < typeof PyConfig > =
35
36
Template . bind ( { } ) ;
36
37
37
38
PyConfigExternalJsonConfigExample . args = {
38
39
type : "json" ,
39
- source : "./test_file.py" ,
40
+ source : pythonTestFile ,
40
41
} ;
41
42
42
43
export const PyConfigExternalTomlConfigExample : StoryFn < typeof PyConfig > =
43
44
Template . bind ( { } ) ;
44
45
45
46
PyConfigExternalTomlConfigExample . args = {
46
47
type : "toml" ,
47
- source : "./test_file.py" ,
48
+ source : pythonTestFile ,
48
49
} ;
49
50
50
51
export const PyConfigTomlConfigExample : StoryFn < typeof PyConfig > =
0 commit comments