@@ -113,7 +262,21 @@ export function Step2SelectAudience({ audience, onUpdate, onNext, onBack }: Step
return (
);
@@ -142,7 +309,9 @@ export function Step2SelectAudience({ audience, onUpdate, onNext, onBack }: Step
{loadingTags ? (
) : tags.length === 0 ? (
-
No tags found. Create tags in Settings.
+
+ No tags found. Create tags in Settings.
+
) : (
{tags.map((tag) => {
@@ -170,27 +339,122 @@ export function Step2SelectAudience({ audience, onUpdate, onNext, onBack }: Step
)}
+ {audience.type === 'custom_field' && (
+
+
Custom Field Filter
+ {loadingFields ? (
+
+ ) : customFields.length === 0 ? (
+
+ No custom fields defined. Create one in Settings → Custom Fields.
+
+ ) : (
+
+
+
+ updateCustomField({ value: e.target.value })}
+ placeholder="Value"
+ className="h-9 rounded-lg border border-slate-700 bg-slate-800 px-2.5 text-sm text-white outline-none placeholder:text-slate-500 focus:border-emerald-500 focus:ring-1 focus:ring-emerald-500"
+ />
+
+ )}
+
+ )}
+
+ {/* Exclude list — applies regardless of audience type */}
+
+
+
+
+ Exclude contacts with these tags
+
+
(optional)
+
+ {tags.length === 0 ? (
+
No tags available.
+ ) : (
+
+ {tags.map((tag) => {
+ const isExcluded = audience.excludeTagIds?.includes(tag.id);
+ return (
+
+ );
+ })}
+
+ )}
+
+
{/* Audience Summary */}
Audience Summary
{loadingCount ? (
- Calculating...
+ Calculating…
) : estimatedCount !== null ? (
- {estimatedCount.toLocaleString()}
+
+ {estimatedCount.toLocaleString()}
+
estimated recipients
) : (
-
Select an audience type to see the estimate.
+
+ Select an audience type to see the estimate.
+
)}
-