11import type { Meta , StoryFn } from "@storybook/react" ;
2-
32import PyScriptProvider from "~root/source/library/components/py-script-provider/py-script-provider" ;
4-
53import PyConfig from "./py-config" ;
6-
74import type { PyConfigProperties , PyConfigTag } from "./py-config.types" ;
85
96export default {
107 component : PyConfig ,
118} as Meta < typeof PyConfig > ;
129
10+ const pythonTestFile : string = "./test_file.py" ;
11+
1312const Template : StoryFn < PyConfigTag > = < T extends object > ( {
1413 ...rest
1514} : PyConfigProperties < T > ) : JSX . Element => {
@@ -26,25 +25,27 @@ PyConfigExample.args = {
2625 type : "json" ,
2726 packages : new Set ( [ "matplotlib" , "numpy" , "folium" ] ) ,
2827 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+ ] ,
3233} ;
3334
3435export const PyConfigExternalJsonConfigExample : StoryFn < typeof PyConfig > =
3536 Template . bind ( { } ) ;
3637
3738PyConfigExternalJsonConfigExample . args = {
3839 type : "json" ,
39- source : "./test_file.py" ,
40+ source : pythonTestFile ,
4041} ;
4142
4243export const PyConfigExternalTomlConfigExample : StoryFn < typeof PyConfig > =
4344 Template . bind ( { } ) ;
4445
4546PyConfigExternalTomlConfigExample . args = {
4647 type : "toml" ,
47- source : "./test_file.py" ,
48+ source : pythonTestFile ,
4849} ;
4950
5051export const PyConfigTomlConfigExample : StoryFn < typeof PyConfig > =
0 commit comments