diff --git a/packages/desktop-client/src/components/budget/IncomeCategory.js b/packages/desktop-client/src/components/budget/IncomeCategory.tsx similarity index 60% rename from packages/desktop-client/src/components/budget/IncomeCategory.js rename to packages/desktop-client/src/components/budget/IncomeCategory.tsx index 1be5884b031..61836300f33 100644 --- a/packages/desktop-client/src/components/budget/IncomeCategory.js +++ b/packages/desktop-client/src/components/budget/IncomeCategory.tsx @@ -1,10 +1,26 @@ -import React from 'react'; +import React, { ComponentProps } from 'react'; -import { useDraggable, useDroppable, DropHighlight } from '../sort'; +import { useDraggable, useDroppable, DropHighlight, OnDragChangeCallback, OnDropCallback } from '../sort'; import { Row } from '../table'; import RenderMonths from './RenderMonths'; import SidebarCategory from './SidebarCategory'; +import { CategoryEntity } from 'loot-core/src/types/models'; + +type IncomeCategoryProps = { + cat: CategoryEntity; + isLast?: boolean; + editingCell: { id: string; cell: string } | null; + MonthComponent: ComponentProps["component"]; + onEditName: ComponentProps["onEditName"]; + onEditMonth?: (id: string, monthIndex: number) => void; + onSave: ComponentProps["onSave"]; + onDelete: ComponentProps["onDelete"]; + onDragChange: OnDragChangeCallback; + onBudgetAction: (idx: number, action: string, arg: unknown) => void; + onReorder: OnDropCallback; + onShowActivity: (name: string, id: string, idx: number) => void; +}; function IncomeCategory({ cat, @@ -19,7 +35,7 @@ function IncomeCategory({ onBudgetAction, onReorder, onShowActivity, -}) { +}: IncomeCategoryProps) { let { dragRef } = useDraggable({ type: 'income-category', onDragChange, diff --git a/upcoming-release-notes/1897.md b/upcoming-release-notes/1897.md index 9eaf66be8b6..6f32a5447fb 100644 --- a/upcoming-release-notes/1897.md +++ b/upcoming-release-notes/1897.md @@ -3,4 +3,4 @@ category: Maintenance authors: [MikesGlitch] --- -Convert ExpenseGroup, ExpenseCategory components to Typescript. +Convert ExpenseGroup, ExpenseCategory, IncomeCategory components to Typescript.