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:
@@ -2,6 +2,7 @@
|
||||
import React from 'react';
|
||||
import { Input } from '@/components/ui/input';
|
||||
import { EXPENSE_CATEGORIES } from '@/constants/categoryIcons';
|
||||
import { useIsMobile } from '@/hooks/use-mobile';
|
||||
|
||||
interface CategoryBudgetInputsProps {
|
||||
categoryBudgets: Record<string, number>;
|
||||
@@ -12,6 +13,8 @@ const CategoryBudgetInputs: React.FC<CategoryBudgetInputsProps> = ({
|
||||
categoryBudgets,
|
||||
handleCategoryInputChange
|
||||
}) => {
|
||||
const isMobile = useIsMobile();
|
||||
|
||||
// Format number with commas for display
|
||||
const formatWithCommas = (value: number): string => {
|
||||
if (value === 0) return '';
|
||||
@@ -26,15 +29,15 @@ const CategoryBudgetInputs: React.FC<CategoryBudgetInputsProps> = ({
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="space-y-2">
|
||||
<div className="space-y-2 w-full">
|
||||
{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>
|
||||
<Input
|
||||
value={formatWithCommas(categoryBudgets[category] || 0)}
|
||||
onChange={(e) => handleInput(e, category)}
|
||||
placeholder="예산 입력"
|
||||
className="neuro-pressed max-w-[150px] text-xs"
|
||||
className={`neuro-pressed ${isMobile ? 'w-[150px]' : 'max-w-[150px]'} text-xs`}
|
||||
/>
|
||||
</div>
|
||||
))}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
|
||||
import React from 'react';
|
||||
import { formatCurrency } from '@/utils/formatters';
|
||||
import { useIsMobile } from '@/hooks/use-mobile';
|
||||
|
||||
interface CategorySpending {
|
||||
title: string;
|
||||
@@ -17,6 +18,8 @@ const CategorySpendingList: React.FC<CategorySpendingListProps> = ({
|
||||
categories,
|
||||
totalExpense
|
||||
}) => {
|
||||
const isMobile = useIsMobile();
|
||||
|
||||
// 카테고리별 색상 매핑
|
||||
const getCategoryColor = (title: string) => {
|
||||
switch (title) {
|
||||
@@ -28,7 +31,7 @@ const CategorySpendingList: React.FC<CategorySpendingListProps> = ({
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="neuro-card mb-6">
|
||||
<div className={`neuro-card mb-6 ${isMobile ? 'w-full' : ''}`}>
|
||||
{categories.some(cat => cat.current > 0) ? (
|
||||
<div className="space-y-4">
|
||||
{categories.map((category) => (
|
||||
|
||||
@@ -17,7 +17,7 @@ const PeriodSelector: React.FC<PeriodSelectorProps> = ({
|
||||
const isMobile = useIsMobile();
|
||||
|
||||
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
|
||||
className="neuro-flat p-2 rounded-full"
|
||||
onClick={onPrevPeriod}
|
||||
|
||||
@@ -18,7 +18,7 @@ const SummaryCards: React.FC<SummaryCardsProps> = ({
|
||||
const isMobile = useIsMobile();
|
||||
|
||||
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="flex items-center gap-2 mb-1 py-[5px]">
|
||||
<Wallet size={24} className="text-gray-500" />
|
||||
|
||||
@@ -81,7 +81,7 @@ const Analytics = () => {
|
||||
<div className="min-h-screen bg-neuro-background pb-24">
|
||||
<div className={`mx-auto px-4 ${isMobile ? 'w-full' : 'max-w-lg'}`}>
|
||||
{/* Header */}
|
||||
<header className="py-8">
|
||||
<header className="py-8 w-full">
|
||||
<h1 className="text-2xl font-bold neuro-text mb-5">지출 분석</h1>
|
||||
|
||||
{/* Period Selector */}
|
||||
@@ -100,7 +100,7 @@ const Analytics = () => {
|
||||
</header>
|
||||
|
||||
{/* Monthly Comparison Chart */}
|
||||
<div className="mb-8">
|
||||
<div className="mb-8 w-full">
|
||||
<h2 className="text-lg font-semibold mb-3">월별 그래프</h2>
|
||||
<MonthlyComparisonChart
|
||||
monthlyData={monthlyData}
|
||||
|
||||
Reference in New Issue
Block a user