Refactor: Split Index page
Refactor Index.tsx into smaller, more manageable components.
This commit is contained in:
26
src/components/RecentTransactionsSection.tsx
Normal file
26
src/components/RecentTransactionsSection.tsx
Normal file
@@ -0,0 +1,26 @@
|
||||
|
||||
import React from 'react';
|
||||
import TransactionCard, { Transaction } from '@/components/TransactionCard';
|
||||
|
||||
interface RecentTransactionsSectionProps {
|
||||
transactions: Transaction[];
|
||||
}
|
||||
|
||||
const RecentTransactionsSection: React.FC<RecentTransactionsSectionProps> = ({ transactions }) => {
|
||||
return (
|
||||
<>
|
||||
<h2 className="text-lg font-semibold mb-3 mt-8">최근 지출</h2>
|
||||
<div className="grid gap-3 mb-6">
|
||||
{transactions.map(transaction => (
|
||||
<TransactionCard key={transaction.id} transaction={transaction} />
|
||||
))}
|
||||
</div>
|
||||
|
||||
<div className="flex justify-center mb-6">
|
||||
<button className="text-neuro-income font-medium">모든 거래 보기</button>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default RecentTransactionsSection;
|
||||
Reference in New Issue
Block a user