(code: string)
| 19 | } |
| 20 | |
| 21 | function codeHeight(code: string): number { |
| 22 | const headerHeight = 40 |
| 23 | const footerHeight = 40 |
| 24 | const lineHeight = 20 |
| 25 | const padding = 4 |
| 26 | const visualSpacer = 20 // To make things look nicer |
| 27 | const widgetHeight = 30 |
| 28 | const widgetsHeight = countPlaygroundWidgets(code) * widgetHeight |
| 29 | const codeHeight = code.split('\n').length * lineHeight |
| 30 | |
| 31 | return ( |
| 32 | headerHeight + |
| 33 | padding + |
| 34 | codeHeight + |
| 35 | widgetsHeight + |
| 36 | visualSpacer + |
| 37 | padding + |
| 38 | footerHeight |
| 39 | ) |
| 40 | } |
| 41 | |
| 42 | interface Props { |
| 43 | variant?: 'slides' |
no test coverage detected