{"size": 1003, "ext": "js", "max_stars_repo_path": "src/utils/codeSnippets.js", "max_stars_repo_name": "jonasholbech/svelte-story-generator-w-stories", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/utils/codeSnippets.js", "max_issues_repo_name": "jonasholbech/svelte-story-generator-w-stories", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/utils/codeSnippets.js", "max_forks_repo_name": "jonasholbech/svelte-story-generator-w-stories", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 21.8043478261, "max_line_length": 80, "alphanum_fraction": 0.5523429711}
export function getComponentCode(state) {
  const props = state.props
    .map((p) => {
      return `export let ${p};\n`;
    })
    .join("\t");

  return `<script>
    ${props}</script>

<!-- Your HTML goes here -->
<style>
  
</style>`;
}
function quote(value) {
  if (isNaN(value)) {
    return `"${value}"`;
  }
  return value;
}
export function getStoryCode(state) {
  let storyStrings = [];
  state.stories.map((story) => {
    const args = story.props
      .map((prop) => {
        return prop.prop + ": " + quote(prop.value);
      })
      .join(", ");
    storyStrings.push(`<Story name="${story.name}" args={{ ${args} }} />`);
  });
  return `
    <script>
    import { Meta, Template, Story } from "@storybook/addon-svelte-csf";
    import ${state.name} from "./${state.name}.svelte";
  </script>
  
  <Meta title="Example/${state.name}" component={${state.name}} argTypes={{}} />
  
  <Template let:args>
    <${state.name} {...args} />
  </Template>
  
  ${storyStrings.join("\n")}`;
}
