feat: add icon support to category creation and editing, enhance transaction rule creation with new dialog and filters
This commit is contained in:
@@ -29,6 +29,7 @@ export default function CategoriesPage() {
|
||||
const [formData, setFormData] = useState({
|
||||
name: "",
|
||||
color: "#22c55e",
|
||||
icon: "tag",
|
||||
keywords: [] as string[],
|
||||
parentId: null as string | null,
|
||||
});
|
||||
@@ -132,7 +133,7 @@ export default function CategoriesPage() {
|
||||
|
||||
const handleNewCategory = (parentId: string | null = null) => {
|
||||
setEditingCategory(null);
|
||||
setFormData({ name: "", color: "#22c55e", keywords: [], parentId });
|
||||
setFormData({ name: "", color: "#22c55e", icon: "tag", keywords: [], parentId });
|
||||
setIsDialogOpen(true);
|
||||
};
|
||||
|
||||
@@ -141,6 +142,7 @@ export default function CategoriesPage() {
|
||||
setFormData({
|
||||
name: category.name,
|
||||
color: category.color,
|
||||
icon: category.icon,
|
||||
keywords: [...category.keywords],
|
||||
parentId: category.parentId,
|
||||
});
|
||||
@@ -154,6 +156,7 @@ export default function CategoriesPage() {
|
||||
...editingCategory,
|
||||
name: formData.name,
|
||||
color: formData.color,
|
||||
icon: formData.icon,
|
||||
keywords: formData.keywords,
|
||||
parentId: formData.parentId,
|
||||
});
|
||||
@@ -161,8 +164,8 @@ export default function CategoriesPage() {
|
||||
await addCategory({
|
||||
name: formData.name,
|
||||
color: formData.color,
|
||||
icon: formData.icon,
|
||||
keywords: formData.keywords,
|
||||
icon: "tag",
|
||||
parentId: formData.parentId,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user