(config: WorkspaceConfiguration, withLoader: boolean = false)
| 1 | import type { WorkspaceConfiguration } from "vscode"; |
| 2 | |
| 3 | export const generateComponent = (config: WorkspaceConfiguration, withLoader: boolean = false) => { |
| 4 | const customComponent = config.get("component"); |
| 5 | if (customComponent) { |
| 6 | return customComponent + "\n"; |
| 7 | } |
| 8 | return [ |
| 9 | `export default function RouteComponent(){`, |
| 10 | ...(withLoader ? [` const data = useLoaderData<typeof loader>()`] : []), |
| 11 | ` return (`, |
| 12 | ` <div />`, |
| 13 | ` );`, |
| 14 | `}`, |
| 15 | ].join("\n"); |
| 16 | }; |
nothing calls this directly
no outgoing calls
no test coverage detected