MCPcopy Create free account
hub / github.com/adobe/react-spectrum / renderImport

Function renderImport

packages/dev/s2-docs/src/VisualExampleClient.tsx:646–662  ·  view source on GitHub ↗
(name, from, isDefault = false)

Source from the content-addressed store, hash-verified

644}
645
646function renderImport(name, from, isDefault = false) {
647 return (
648 <Fragment key={from}>
649 <span className={style({color: 'magenta-1000'})}>import</span> {isDefault ? null : '{'}
650 {name}
651 {isDefault ? null : '}'} <span className={style({color: 'magenta-1000'})}>from</span>{' '}
652 {from.startsWith('./') ? (
653 <TabLink className={style({color: 'green-1000'})} name={from.slice(2)}>
654 '{from}'
655 </TabLink>
656 ) : (
657 <span className={style({color: 'green-1000'})}>'{from}'</span>
658 )}
659 {';'}
660 </Fragment>
661 );
662}
663
664export function Control({name}: {name: string}) {
665 let {controls, props, setProps} = useContext(Context);

Callers 1

renderImportsFunction · 0.85

Calls 1

sliceMethod · 0.80

Tested by

no test coverage detected