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

Function renderImport

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

Source from the content-addressed store, hash-verified

652}
653
654function 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
672export function Control({name}: {name: string}) {
673 let {controls, props, setProps} = useContext(Context);

Callers 1

renderImportsFunction · 0.85

Calls 1

sliceMethod · 0.80

Tested by

no test coverage detected