Changes
Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com>
This commit is contained in:
co-authored by
renee-png
parent
e8c1fe75b3
commit
ade0d57bfb
@@ -429,6 +429,43 @@ export function ConvertToCollectionsDialog({
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div className="border rounded-md p-3 space-y-2 bg-muted/20">
|
||||
<label className="flex items-center gap-2 text-sm cursor-pointer">
|
||||
<Checkbox
|
||||
checked={combine}
|
||||
onCheckedChange={(v) => setCombine(!!v)}
|
||||
/>
|
||||
<span>
|
||||
Combine into one collection (recommended)
|
||||
<span className="block text-xs text-muted-foreground font-normal">
|
||||
Creates a single ledger for the case. Uncheck to make one ledger per homeowner.
|
||||
</span>
|
||||
</span>
|
||||
</label>
|
||||
{combine && selected.size > 1 && (
|
||||
<div className="pt-1">
|
||||
<Label className="text-xs">Primary homeowner</Label>
|
||||
<Select
|
||||
value={primaryId ?? Array.from(selected)[0] ?? ""}
|
||||
onValueChange={(v) => setPrimaryId(v)}
|
||||
>
|
||||
<SelectTrigger>
|
||||
<SelectValue placeholder="Pick primary homeowner" />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
{contacts
|
||||
.filter((c) => selected.has(c.id))
|
||||
.map((c) => (
|
||||
<SelectItem key={c.id} value={c.id}>
|
||||
{c.name}
|
||||
</SelectItem>
|
||||
))}
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div className="border rounded-md p-3 space-y-2 bg-muted/20">
|
||||
<label className="flex items-center gap-2 text-sm cursor-pointer">
|
||||
<Checkbox
|
||||
@@ -456,8 +493,9 @@ export function ConvertToCollectionsDialog({
|
||||
disabled={submitting || (selected.size === 0 && !includeEmpty)}
|
||||
>
|
||||
{submitting && <Loader2 className="h-4 w-4 mr-2 animate-spin" />}
|
||||
Create {selected.size + (includeEmpty ? 1 : 0)} collection
|
||||
{selected.size + (includeEmpty ? 1 : 0) === 1 ? "" : "s"}
|
||||
{combine && selected.size > 0
|
||||
? `Create 1 combined collection${includeEmpty ? " + 1 empty" : ""}`
|
||||
: `Create ${selected.size + (includeEmpty ? 1 : 0)} collection${selected.size + (includeEmpty ? 1 : 0) === 1 ? "" : "s"}`}
|
||||
</Button>
|
||||
</DialogFooter>
|
||||
</DialogContent>
|
||||
|
||||
Reference in New Issue
Block a user