Skip to content

Commit 1f5e322

Browse files
Copilothuangyiirene
andcommitted
Changes before error encountered
Co-authored-by: huangyiirene <7665279+huangyiirene@users.noreply.github.com>
1 parent d7c104c commit 1f5e322

5 files changed

Lines changed: 12 additions & 7 deletions

File tree

packages/components/src/renderers/layout/card.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { ComponentRegistry } from '@object-ui/core';
2+
import type { CardSchema } from '@object-ui/types';
23
import { renderChildren } from '../../lib/utils';
34
import {
45
Card,
@@ -10,7 +11,7 @@ import {
1011
} from '@/ui';
1112

1213
ComponentRegistry.register('card',
13-
({ schema, className, ...props }) => (
14+
({ schema, className, ...props }: { schema: CardSchema; className?: string; [key: string]: any }) => (
1415
<Card className={className} {...props}>
1516
{(schema.title || schema.description) && (
1617
<CardHeader>

packages/components/src/renderers/layout/container.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import { ComponentRegistry } from '@object-ui/core';
2+
import type { ContainerSchema } from '@object-ui/types';
23
import { renderChildren } from '../../lib/utils';
34
import { cn } from '@/lib/utils';
45

56
ComponentRegistry.register('container',
6-
({ schema, className, ...props }) => {
7+
({ schema, className, ...props }: { schema: ContainerSchema; className?: string; [key: string]: any }) => {
78
const maxWidth = schema.maxWidth || 'xl';
89
const padding = schema.padding || 4;
910
const centered = schema.centered !== false; // Default to true

packages/components/src/renderers/layout/flex.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import { ComponentRegistry } from '@object-ui/core';
2+
import type { FlexSchema } from '@object-ui/types';
23
import { renderChildren } from '../../lib/utils';
34
import { cn } from '@/lib/utils';
45

56
ComponentRegistry.register('flex',
6-
({ schema, className, ...props }) => {
7+
({ schema, className, ...props }: { schema: FlexSchema; className?: string; [key: string]: any }) => {
78
const direction = schema.direction || 'row';
89
const justify = schema.justify || 'start';
910
const align = schema.align || 'start';

packages/components/src/renderers/layout/grid.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import { ComponentRegistry } from '@object-ui/core';
2+
import type { GridSchema } from '@object-ui/types';
23
import { renderChildren } from '../../lib/utils';
34
import { cn } from '@/lib/utils';
45

56
ComponentRegistry.register('grid',
6-
({ schema, className, ...props }) => {
7+
({ schema, className, ...props }: { schema: GridSchema; className?: string; [key: string]: any }) => {
78
const gridCols = schema.columns || 2;
89
const gap = schema.gap || 4;
910

packages/components/src/renderers/layout/tabs.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { ComponentRegistry } from '@object-ui/core';
2+
import type { TabsSchema } from '@object-ui/types';
23
import { renderChildren } from '../../lib/utils';
34
import {
45
Tabs,
@@ -8,14 +9,14 @@ import {
89
} from '@/ui';
910

1011
ComponentRegistry.register('tabs',
11-
({ schema, className, ...props }) => (
12+
({ schema, className, ...props }: { schema: TabsSchema; className?: string; [key: string]: any }) => (
1213
<Tabs defaultValue={schema.defaultValue} className={className} {...props}>
1314
<TabsList>
14-
{schema.items?.map((item: any) => (
15+
{schema.items?.map((item) => (
1516
<TabsTrigger key={item.value} value={item.value}>{item.label}</TabsTrigger>
1617
))}
1718
</TabsList>
18-
{schema.items?.map((item: any) => (
19+
{schema.items?.map((item) => (
1920
<TabsContent key={item.value} value={item.value}>
2021
{renderChildren(item.body)}
2122
</TabsContent>

0 commit comments

Comments
 (0)