From bd8bcc42860d75b62df712b5c4a2fe1fd4c94657 Mon Sep 17 00:00:00 2001 From: "[dyad]" Date: Wed, 21 Jan 2026 13:17:34 +0100 Subject: [PATCH] [dyad] Fixing schema display build error - wrote 1 file(s) --- src/components/schema-display.tsx | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/src/components/schema-display.tsx b/src/components/schema-display.tsx index de4039d..10ee138 100644 --- a/src/components/schema-display.tsx +++ b/src/components/schema-display.tsx @@ -15,16 +15,19 @@ interface SchemaDisplayProps { } export function SchemaDisplay({ schemas }: SchemaDisplayProps) { - const groupedSchemas = schemas.reduce((acc, schema) => { - const type = Array.isArray(schema["@type"]) - ? schema["@type"].join(", ") - : schema["@type"] || "Untyped"; - if (!acc[type]) { - acc[type] = []; - } - acc[type].push(schema); - return acc; - }, {} as Record); + const groupedSchemas = schemas.reduce( + (acc: Record, schema: any) => { + const type = Array.isArray(schema["@type"]) + ? schema["@type"].join(", ") + : schema["@type"] || "Untyped"; + if (!acc[type]) { + acc[type] = []; + } + acc[type].push(schema); + return acc; + }, + {} + ); const SchemaContent = ({ schema }: { schema: any }) => { const schemaJson = JSON.stringify(schema, null, 2); @@ -55,7 +58,7 @@ export function SchemaDisplay({ schemas }: SchemaDisplayProps) { {Object.entries(groupedSchemas).map( - ([type, schemaGroup], groupIndex) => ( + ([type, schemaGroup]: [string, any[]], groupIndex: number) => ( - {schemaGroup.map((schema, schemaIndex) => ( + {schemaGroup.map((schema: any, schemaIndex: number) => (