Import AITURK IDE 1.0.0-beta.1 from Hermes 63279301; preserve MIT license
This commit is contained in:
commit
03634b1ca3
11340 files changed
+3442369
No files matched your search
@@ -0,0 +1,26 @@
|
||||
import { ContribBoundary, ContribRender } from './boundary'
|
||||
import { useContributions } from './use-contributions'
|
||||
|
||||
export interface SlotProps {
|
||||
/** Area id whose contributions render inline, in order. */
|
||||
area: string
|
||||
}
|
||||
|
||||
/** Renders a bar area: ordered inline items `[...core, ...plugin]`. */
|
||||
export function Slot({ area }: SlotProps) {
|
||||
const items = useContributions(area)
|
||||
|
||||
if (items.length === 0) {
|
||||
return null
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
{items.map(c => (
|
||||
<ContribBoundary id={c.id} key={`${c.source ?? 'core'}:${c.id}`} variant="chip">
|
||||
{c.render && <ContribRender render={c.render} />}
|
||||
</ContribBoundary>
|
||||
))}
|
||||
</>
|
||||
)
|
||||
}
|
||||
Reference in new issue
Block a user