feat(Composite): Enhance root and child rendering with error differentiation
- Adjusted Composite to conditionally check for both direct root and child rendering. - Differentiated error states: omitting an error when `component` prop is absent but showing an error when it's undefined. - Fixed rendering of @app in the messages stream.
This commit is contained in:
@ -40,7 +40,7 @@
|
||||
<!-- Render Composite Component -->
|
||||
{#if message.composite}
|
||||
<div class="overflow-y-auto max-h-80vh">
|
||||
<Composite componentsData={message.composite} />
|
||||
<Composite composite={message.composite} />
|
||||
</div>
|
||||
{/if}
|
||||
{/each}
|
||||
|
@ -13,11 +13,8 @@
|
||||
const match = text.match(appCommandPattern);
|
||||
if (match && match[1]) {
|
||||
message.composite = {
|
||||
children: [
|
||||
{
|
||||
component: match[1] // Matched component name
|
||||
}
|
||||
]
|
||||
id: match[1],
|
||||
component: match[1]
|
||||
};
|
||||
}
|
||||
console.log(message);
|
||||
|
Reference in New Issue
Block a user