From 92173fa4bd0ed4c95c64b0b5cef30012eff884f5 Mon Sep 17 00:00:00 2001 From: carkom Date: Mon, 8 Jan 2024 09:13:23 +0000 Subject: [PATCH] category choice --- .../components/modals/ImportTransactions.jsx | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/packages/desktop-client/src/components/modals/ImportTransactions.jsx b/packages/desktop-client/src/components/modals/ImportTransactions.jsx index 79f23a37a84..f6c197d92f5 100644 --- a/packages/desktop-client/src/components/modals/ImportTransactions.jsx +++ b/packages/desktop-client/src/components/modals/ImportTransactions.jsx @@ -327,7 +327,8 @@ function Transaction({ multiplierAmount, categories, }) { - const categoryList = categories.map(category => category.name); + const [category, setCategory] = useState(); + const categoryList = categories.list.map(category => category.name); const transaction = useMemo( () => fieldMappings @@ -348,6 +349,8 @@ function Transaction({ outflow = amountToCurrency(outflow); inflow = amountToCurrency(inflow); + const filteredList = categories.list.filter(cat => cat.name === transaction.category); + return ( - {categoryList.includes(transaction.category) && transaction.category} + {filteredList.length > 1 ? +