MCPcopy Create free account
hub / github.com/bernaferrari/FigmaToCode / getPreviewTemplate

Function getPreviewTemplate

packages/backend/src/swiftui/swiftuiMain.ts:22–35  ·  view source on GitHub ↗
(name: string, injectCode: string)

Source from the content-addressed store, hash-verified

20}`;
21
22const getPreviewTemplate = (name: string, injectCode: string): string =>
23 `import SwiftUI
24
25struct ContentView: View {
26 var body: some View {
27 ${indentString(injectCode, 4).trimStart()};
28 }
29}
30
31struct ContentView_Previews: PreviewProvider {
32 static var previews: some View {
33 ContentView()
34 }
35}`;
36
37export const swiftuiMain = (
38 sceneNode: Array<SceneNode>,

Callers 1

swiftuiMainFunction · 0.85

Calls 1

indentStringFunction · 0.90

Tested by

no test coverage detected