Skip to content

Commit

Permalink
Fixed lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
SahilDahekar committed Feb 9, 2025
1 parent 3841a37 commit a6a2243
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
6 changes: 2 additions & 4 deletions components/FinancialSummary/BarChartComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import type { ExpenseItem, ExpensesLinkItem } from '@/types/FinancialSummary/Bar
import { loadYearData } from '@/utils/loadYearData';

import ExpensesData from '../../config/finance/json-data/2024/Expenses.json';
import ExpensesLinkData from '../../config/finance/json-data//2024/ExpensesLink.json';
import ExpensesLinkData from '../../config/finance/json-data/2024/ExpensesLink.json';
import { getUniqueCategories } from '../../utils/getUniqueCategories';
import CustomTooltip from './CustomTooltip';
import ExpensesCard from './ExpensesCard';
Expand Down Expand Up @@ -55,9 +55,7 @@ export default function BarChartComponent() {
// Effect to load year-specific data when year changes
useEffect(() => {
// Load data for the selected year (or All_years)
const { expensesData, expensesLinkData } = loadYearData(
selectedYear === 'All Years' ? 'All Years' : selectedYear
);
const { expensesData, expensesLinkData } = loadYearData(selectedYear === 'All Years' ? 'All Years' : selectedYear);

if (Object.keys(expensesData).length === 0) {
// If no data found, fallback to default data
Expand Down
10 changes: 9 additions & 1 deletion components/FinancialSummary/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,15 @@ import type { ExpenseItem, Expenses, ExpensesLink } from '@/types/FinancialSumma
* @param {string} props.month - Month for which expenses are displayed.
* @param {ExpenseItem[]} props.data - Expense data for the month.
*/
export default function Card({ month, data, expensesLinkData }: { month: keyof Expenses; data: ExpenseItem[]; expensesLinkData: ExpensesLink}) {
export default function Card({
month,
data,
expensesLinkData
}: {
month: keyof Expenses;
data: ExpenseItem[];
expensesLinkData: ExpensesLink;
}) {
/**
* Handles the click event on an expense category.
* Opens a new window with the corresponding link if available.
Expand Down
4 changes: 2 additions & 2 deletions components/FinancialSummary/ExpensesCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ import React from 'react';

import type { Expenses } from '@/types/FinancialSummary/BarChartComponent';
import { loadYearData } from '@/utils/loadYearData';

import Card from './Card';

/**
* @description ExpensesCard component displays all expenses for each month.
*/
export default function ExpensesCard({year}: {year: string}) {

export default function ExpensesCard({ year }: { year: string }) {
const { expensesData, expensesLinkData } = loadYearData(year);

return (
Expand Down

0 comments on commit a6a2243

Please sign in to comment.