fix(254): move invoice modal buttons to sticky footer
This commit is contained in:
@@ -154,7 +154,20 @@ export default function InvoicesPage() {
|
|||||||
</Card>
|
</Card>
|
||||||
|
|
||||||
{/* Invoice Detail Modal */}
|
{/* Invoice Detail Modal */}
|
||||||
<Modal isOpen={!!selected} onClose={() => setSelected(null)} title={`Invoice ${selected?.invoiceNumber ?? ""}`} className="max-w-lg">
|
<Modal
|
||||||
|
isOpen={!!selected}
|
||||||
|
onClose={() => setSelected(null)}
|
||||||
|
title={`Invoice ${selected?.invoiceNumber ?? ""}`}
|
||||||
|
className="max-w-lg"
|
||||||
|
footer={selected ? (
|
||||||
|
<>
|
||||||
|
{selected.status !== "VOID" && selected.status !== "PAID" && (
|
||||||
|
<Button variant="danger" size="sm" onClick={() => voidInvoice.mutate(selected.id)} isLoading={voidInvoice.isPending}>Void Invoice</Button>
|
||||||
|
)}
|
||||||
|
<Button variant="outline" size="sm" onClick={() => setSelected(null)}>Close</Button>
|
||||||
|
</>
|
||||||
|
) : undefined}
|
||||||
|
>
|
||||||
{selected && (
|
{selected && (
|
||||||
<div className="space-y-4">
|
<div className="space-y-4">
|
||||||
<div className="bg-gray-50 rounded-lg p-4 space-y-2 text-sm">
|
<div className="bg-gray-50 rounded-lg p-4 space-y-2 text-sm">
|
||||||
@@ -196,13 +209,6 @@ export default function InvoicesPage() {
|
|||||||
disabled={!payForm.amount}>Record Payment</Button>
|
disabled={!payForm.amount}>Record Payment</Button>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<div className="flex justify-between pt-1">
|
|
||||||
{selected.status !== "VOID" && selected.status !== "PAID" && (
|
|
||||||
<Button variant="danger" size="sm" onClick={() => voidInvoice.mutate(selected.id)} isLoading={voidInvoice.isPending}>Void Invoice</Button>
|
|
||||||
)}
|
|
||||||
<Button variant="outline" size="sm" onClick={() => setSelected(null)} className="ml-auto">Close</Button>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|||||||
Reference in New Issue
Block a user