| 652 | } |
| 653 | |
| 654 | function renderImport(name, from, isDefault = false) { |
| 655 | return ( |
| 656 | <Fragment key={from}> |
| 657 | <span className={style({color: 'magenta-1000'})}>import</span> {isDefault ? null : '{'} |
| 658 | {name} |
| 659 | {isDefault ? null : '}'} <span className={style({color: 'magenta-1000'})}>from</span>{' '} |
| 660 | {from.startsWith('./') ? ( |
| 661 | <TabLink className={style({color: 'green-1000'})} name={from.slice(2)}> |
| 662 | '{from}' |
| 663 | </TabLink> |
| 664 | ) : ( |
| 665 | <span className={style({color: 'green-1000'})}>'{from}'</span> |
| 666 | )} |
| 667 | {';'} |
| 668 | </Fragment> |
| 669 | ); |
| 670 | } |
| 671 | |
| 672 | export function Control({name}: {name: string}) { |
| 673 | let {controls, props, setProps} = useContext(Context); |