improved note making

This commit is contained in:
2025-11-21 16:59:02 +01:00
parent 80cb393768
commit 1076b12668

View File

@@ -140,7 +140,8 @@ export const HomePage = () => {
<Table.Cell>{item.item_name}</Table.Cell>
</Table.Row>
))}
</Table.Body>
<Table.Row>
<Table.Cell colSpan={2}>
<InputGroup
endElement={
<Span color="fg.muted" textStyle="xs">
@@ -153,21 +154,29 @@ export const HomePage = () => {
value={note}
maxLength={MAX_CHARACTERS}
onChange={(e) => {
setNote(e.currentTarget.value.slice(0, MAX_CHARACTERS));
setNote(
e.currentTarget.value.slice(0, MAX_CHARACTERS)
);
}}
/>
</InputGroup>
</Table.Cell>
</Table.Row>
</Table.Body>
</Table.Root>
</Table.ScrollArea>
)}
{selectedItems.length >= 1 && (
<Button
onClick={() =>
createLoan(selectedItems, startDate, endDate, note).then((response) => {
createLoan(selectedItems, startDate, endDate, note).then(
(response) => {
if (response.status === "error") {
setMsgStatus("error");
setMsgTitle(response.title || t("error"));
setMsgDescription(response.description || t("unknown-error"));
setMsgDescription(
response.description || t("unknown-error")
);
setIsMsg(true);
return;
}
@@ -175,7 +184,8 @@ export const HomePage = () => {
setMsgTitle(t("success"));
setMsgDescription(t("loan-success"));
setIsMsg(true);
})
}
)
}
>
{t("create-loan")}