Start to build attach multiple entries dialog
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
import {
|
||||
Button,
|
||||
Dialog,
|
||||
DialogActions,
|
||||
DialogContent,
|
||||
DialogTitle,
|
||||
} from "@mui/material";
|
||||
import { InboxEntry } from "../api/InboxApi";
|
||||
import { Movement } from "../api/MovementsApi";
|
||||
|
||||
export function AttachMultipleInboxEntriesDialog(p: {
|
||||
open: boolean;
|
||||
entries: InboxEntry[];
|
||||
movements: Movement[][];
|
||||
onClose: () => void;
|
||||
onSelected: (mapping: Array<number | undefined>) => void;
|
||||
}): React.ReactElement {
|
||||
const handleSubmit = () => {};
|
||||
return (
|
||||
<Dialog open={p.open} onClose={p.onClose}>
|
||||
<DialogTitle>Attach multiple entries to movements</DialogTitle>
|
||||
<DialogContent>TODO</DialogContent>
|
||||
<DialogActions>
|
||||
<Button onClick={p.onClose}>Cancel</Button>
|
||||
<Button onClick={handleSubmit} autoFocus>
|
||||
Perform mapping
|
||||
</Button>
|
||||
</DialogActions>
|
||||
</Dialog>
|
||||
);
|
||||
}
|
@@ -29,7 +29,9 @@ export function SelectAccountDialog(p: {
|
||||
}): React.ReactElement {
|
||||
const accounts = useAccounts();
|
||||
|
||||
const [choice, setChoice] = React.useState<Account | null>(null);
|
||||
const [choice, setChoice] = React.useState<Account | null>(
|
||||
accounts.list.default
|
||||
);
|
||||
|
||||
const submit = () => {
|
||||
if (choice) p.onSelected(choice);
|
||||
|
Reference in New Issue
Block a user