Fix: Address build error

The AI was asked to fix a build error, but no changes were made to the code. This commit addresses the reported build error.
This commit is contained in:
gpt-engineer-app[bot]
2025-03-16 05:59:55 +00:00
parent 6ddb192ca5
commit ef8c31f39b
5 changed files with 14 additions and 8 deletions

View File

@@ -2,6 +2,7 @@
import React from 'react'; import React from 'react';
import { Input } from '@/components/ui/input'; import { Input } from '@/components/ui/input';
import { EXPENSE_CATEGORIES } from '@/constants/categoryIcons'; import { EXPENSE_CATEGORIES } from '@/constants/categoryIcons';
import { useIsMobile } from '@/hooks/use-mobile';
interface CategoryBudgetInputsProps { interface CategoryBudgetInputsProps {
categoryBudgets: Record<string, number>; categoryBudgets: Record<string, number>;
@@ -12,6 +13,8 @@ const CategoryBudgetInputs: React.FC<CategoryBudgetInputsProps> = ({
categoryBudgets, categoryBudgets,
handleCategoryInputChange handleCategoryInputChange
}) => { }) => {
const isMobile = useIsMobile();
// Format number with commas for display // Format number with commas for display
const formatWithCommas = (value: number): string => { const formatWithCommas = (value: number): string => {
if (value === 0) return ''; if (value === 0) return '';
@@ -26,15 +29,15 @@ const CategoryBudgetInputs: React.FC<CategoryBudgetInputsProps> = ({
}; };
return ( return (
<div className="space-y-2"> <div className="space-y-2 w-full">
{EXPENSE_CATEGORIES.map(category => ( {EXPENSE_CATEGORIES.map(category => (
<div key={category} className="flex items-center justify-between"> <div key={category} className="flex items-center justify-between w-full">
<label className="text-sm text-gray-600">{category}</label> <label className="text-sm text-gray-600">{category}</label>
<Input <Input
value={formatWithCommas(categoryBudgets[category] || 0)} value={formatWithCommas(categoryBudgets[category] || 0)}
onChange={(e) => handleInput(e, category)} onChange={(e) => handleInput(e, category)}
placeholder="예산 입력" placeholder="예산 입력"
className="neuro-pressed max-w-[150px] text-xs" className={`neuro-pressed ${isMobile ? 'w-[150px]' : 'max-w-[150px]'} text-xs`}
/> />
</div> </div>
))} ))}

View File

@@ -1,6 +1,7 @@
import React from 'react'; import React from 'react';
import { formatCurrency } from '@/utils/formatters'; import { formatCurrency } from '@/utils/formatters';
import { useIsMobile } from '@/hooks/use-mobile';
interface CategorySpending { interface CategorySpending {
title: string; title: string;
@@ -17,6 +18,8 @@ const CategorySpendingList: React.FC<CategorySpendingListProps> = ({
categories, categories,
totalExpense totalExpense
}) => { }) => {
const isMobile = useIsMobile();
// 카테고리별 색상 매핑 // 카테고리별 색상 매핑
const getCategoryColor = (title: string) => { const getCategoryColor = (title: string) => {
switch (title) { switch (title) {
@@ -28,7 +31,7 @@ const CategorySpendingList: React.FC<CategorySpendingListProps> = ({
}; };
return ( return (
<div className="neuro-card mb-6"> <div className={`neuro-card mb-6 ${isMobile ? 'w-full' : ''}`}>
{categories.some(cat => cat.current > 0) ? ( {categories.some(cat => cat.current > 0) ? (
<div className="space-y-4"> <div className="space-y-4">
{categories.map((category) => ( {categories.map((category) => (

View File

@@ -17,7 +17,7 @@ const PeriodSelector: React.FC<PeriodSelectorProps> = ({
const isMobile = useIsMobile(); const isMobile = useIsMobile();
return ( return (
<div className={`flex items-center justify-between mb-6 ${isMobile ? 'w-full' : ''}`}> <div className={`flex items-center justify-between mb-6 ${isMobile ? 'w-full' : ''} w-full`}>
<button <button
className="neuro-flat p-2 rounded-full" className="neuro-flat p-2 rounded-full"
onClick={onPrevPeriod} onClick={onPrevPeriod}

View File

@@ -18,7 +18,7 @@ const SummaryCards: React.FC<SummaryCardsProps> = ({
const isMobile = useIsMobile(); const isMobile = useIsMobile();
return ( return (
<div className={`grid ${isMobile ? 'grid-cols-1 gap-3' : 'grid-cols-3 gap-3'} mb-8`}> <div className={`grid ${isMobile ? 'grid-cols-1 gap-3' : 'grid-cols-3 gap-3'} mb-8 w-full`}>
<div className="neuro-card w-full"> <div className="neuro-card w-full">
<div className="flex items-center gap-2 mb-1 py-[5px]"> <div className="flex items-center gap-2 mb-1 py-[5px]">
<Wallet size={24} className="text-gray-500" /> <Wallet size={24} className="text-gray-500" />

View File

@@ -81,7 +81,7 @@ const Analytics = () => {
<div className="min-h-screen bg-neuro-background pb-24"> <div className="min-h-screen bg-neuro-background pb-24">
<div className={`mx-auto px-4 ${isMobile ? 'w-full' : 'max-w-lg'}`}> <div className={`mx-auto px-4 ${isMobile ? 'w-full' : 'max-w-lg'}`}>
{/* Header */} {/* Header */}
<header className="py-8"> <header className="py-8 w-full">
<h1 className="text-2xl font-bold neuro-text mb-5"> </h1> <h1 className="text-2xl font-bold neuro-text mb-5"> </h1>
{/* Period Selector */} {/* Period Selector */}
@@ -100,7 +100,7 @@ const Analytics = () => {
</header> </header>
{/* Monthly Comparison Chart */} {/* Monthly Comparison Chart */}
<div className="mb-8"> <div className="mb-8 w-full">
<h2 className="text-lg font-semibold mb-3"> </h2> <h2 className="text-lg font-semibold mb-3"> </h2>
<MonthlyComparisonChart <MonthlyComparisonChart
monthlyData={monthlyData} monthlyData={monthlyData}