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

Function renderImport

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

Source from the content-addressed store, hash-verified

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

Callers 1

renderImportsFunction · 0.85

Calls 1

sliceMethod · 0.80

Tested by

no test coverage detected