diff --git a/client/components/BillModal.jsx b/client/components/BillModal.jsx index a5d66d9..808568d 100644 --- a/client/components/BillModal.jsx +++ b/client/components/BillModal.jsx @@ -23,6 +23,7 @@ import PaymentHistoryList from '@/components/bill-modal/PaymentHistoryList'; import PaymentFormFields from '@/components/bill-modal/PaymentFormFields'; import UnmatchDialogs from '@/components/bill-modal/UnmatchDialogs'; import LinkedTransactionsSection from '@/components/bill-modal/LinkedTransactionsSection'; +import TemplateSection from '@/components/bill-modal/TemplateSection'; import { transactionTitle, isSimilarPayee } from '@/components/bill-modal/transactionDisplay'; import { BILLING_SCHEDULE_OPTIONS, @@ -916,30 +917,14 @@ export default function BillModal({ bill, initialBill, categories, onClose, onSa /> -
- - {saveTemplate && ( -
- - setTemplateName(e.target.value)} - placeholder={name || 'My bill template'} - /> -
- )} -
+ diff --git a/client/components/bill-modal/TemplateSection.jsx b/client/components/bill-modal/TemplateSection.jsx new file mode 100644 index 0000000..af36b5b --- /dev/null +++ b/client/components/bill-modal/TemplateSection.jsx @@ -0,0 +1,38 @@ +import { Label } from '@/components/ui/label'; +import { Input } from '@/components/ui/input'; + +// "Save this setup as a reusable template" toggle + optional template name. +// Presentational — the parent owns the state and performs the save. +export default function TemplateSection({ + inp, + saveTemplate, setSaveTemplate, + templateName, setTemplateName, + namePlaceholder, +}) { + return ( +
+ + {saveTemplate && ( +
+ + setTemplateName(e.target.value)} + placeholder={namePlaceholder || 'My bill template'} + /> +
+ )} +
+ ); +}