From 6027f3852843cace5fc558649ef5561333e9b82c Mon Sep 17 00:00:00 2001 From: Ricard Mallafre Date: Sat, 20 Apr 2024 13:35:29 +0200 Subject: [PATCH] refactor: select all, align right --- src/app/dashboard/file/page.tsx | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/app/dashboard/file/page.tsx b/src/app/dashboard/file/page.tsx index 931c847..2509747 100644 --- a/src/app/dashboard/file/page.tsx +++ b/src/app/dashboard/file/page.tsx @@ -189,7 +189,7 @@ export default function FilePage() { {transaction.checked ? : } {format(transaction.date, 'yyyy-MM-dd')} - {transaction.amount} + {transaction.amount} { @@ -212,6 +212,7 @@ export default function FilePage() { e.target.select()} defaultValue={transaction.description} onChange={(event) => { setTransactions((transactions) => { @@ -225,13 +226,27 @@ export default function FilePage() { /> - + e.target.select()} + defaultValue={transaction.tags} + onChange={(event) => { + setTransactions((transactions) => { + const res = [...transactions]; + const t = res[i]; + if (!t) return res; + res[i] = { ...t, tags: event.target.value }; + return res; + }); + }} + /> ))} - + ) : null}