Skip to content

Commit 47770de

Browse files
Copilothotlong
andcommitted
Improve type safety for VIEW_TYPE_ICONS and view tab mapping
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent fd1801e commit 47770de

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

apps/console/src/components/ObjectView.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import { MetadataToggle, MetadataPanel, useMetadataInspector } from './MetadataI
2626
import { useObjectActions } from '../hooks/useObjectActions';
2727

2828
/** Map view types to Lucide icons (Airtable-style) */
29-
const VIEW_TYPE_ICONS: Record<string, ComponentType<any>> = {
29+
const VIEW_TYPE_ICONS: Record<string, ComponentType<{ className?: string }>> = {
3030
grid: TableIcon,
3131
kanban: KanbanSquare,
3232
calendar: Calendar,
@@ -289,7 +289,7 @@ export function ObjectView({ dataSource, objects, onEdit, onRowClick }: any) {
289289
{views.length > 1 && (
290290
<div className="border-b px-3 sm:px-4 bg-background overflow-x-auto shrink-0">
291291
<div className="flex items-center gap-0.5 -mb-px">
292-
{views.map((view: any) => {
292+
{views.map((view: { id: string; label: string; type: string }) => {
293293
const isActive = view.id === activeViewId;
294294
const ViewIcon = VIEW_TYPE_ICONS[view.type] || TableIcon;
295295
return (

0 commit comments

Comments
 (0)