feat: implement hierarchical category management with parent-child relationships and enhance category creation dialog
This commit is contained in:
@@ -17,6 +17,7 @@ import {
|
||||
DropdownMenuSeparator,
|
||||
} from "@/components/ui/dropdown-menu"
|
||||
import { OFXImportDialog } from "@/components/import/ofx-import-dialog"
|
||||
import { CategoryIcon } from "@/components/ui/category-icon"
|
||||
import { Search, CheckCircle2, Circle, MoreVertical, Tags, Upload, RefreshCw, ArrowUpDown, Check } from "lucide-react"
|
||||
import { cn } from "@/lib/utils"
|
||||
|
||||
@@ -274,7 +275,7 @@ export default function TransactionsPage() {
|
||||
<DropdownMenuSeparator />
|
||||
{data.categories.map((cat) => (
|
||||
<DropdownMenuItem key={cat.id} onClick={() => bulkSetCategory(cat.id)}>
|
||||
<div className="w-3 h-3 rounded-full mr-2" style={{ backgroundColor: cat.color }} />
|
||||
<CategoryIcon icon={cat.icon} color={cat.color} size={14} className="mr-2" />
|
||||
{cat.name}
|
||||
</DropdownMenuItem>
|
||||
))}
|
||||
@@ -392,11 +393,13 @@ export default function TransactionsPage() {
|
||||
{category ? (
|
||||
<Badge
|
||||
variant="secondary"
|
||||
className="gap-1"
|
||||
style={{
|
||||
backgroundColor: `${category.color}20`,
|
||||
color: category.color,
|
||||
}}
|
||||
>
|
||||
<CategoryIcon icon={category.icon} color={category.color} size={12} />
|
||||
{category.name}
|
||||
</Badge>
|
||||
) : (
|
||||
@@ -413,10 +416,7 @@ export default function TransactionsPage() {
|
||||
<DropdownMenuSeparator />
|
||||
{data.categories.map((cat) => (
|
||||
<DropdownMenuItem key={cat.id} onClick={() => setCategory(transaction.id, cat.id)}>
|
||||
<div
|
||||
className="w-3 h-3 rounded-full mr-2"
|
||||
style={{ backgroundColor: cat.color }}
|
||||
/>
|
||||
<CategoryIcon icon={cat.icon} color={cat.color} size={14} className="mr-2" />
|
||||
{cat.name}
|
||||
{transaction.categoryId === cat.id && <Check className="w-4 h-4 ml-auto" />}
|
||||
</DropdownMenuItem>
|
||||
|
||||
Reference in New Issue
Block a user