fix: keep outreach funnel response rollout-compatible
This commit is contained in:
1 parent
1515b3e291
commit
5c57ed337b
6 files changed
+12
-55
No files matched your search
@@ -38,29 +38,7 @@ function formatWaitTime(timestamp: number, now: number): string {
|
||||
return `in ${Math.ceil(remaining / 86_400_000)}d`;
|
||||
}
|
||||
|
||||
type PhysiqueTargeting = { enabled: boolean; minScore: number; maxScore: number };
|
||||
|
||||
function targetingLabel(current: PhysiqueTargeting, prepared: PhysiqueTargeting | null): string {
|
||||
if (current.enabled) {
|
||||
const currentLabel = `Current target ${current.minScore}–${current.maxScore}`;
|
||||
if (!prepared?.enabled) return `${currentLabel} · Prepared with filter off`;
|
||||
if (prepared.minScore !== current.minScore || prepared.maxScore !== current.maxScore) {
|
||||
return `${currentLabel} · Prepared for ${prepared.minScore}–${prepared.maxScore}`;
|
||||
}
|
||||
return currentLabel;
|
||||
}
|
||||
return prepared?.enabled
|
||||
? `Current filter off · Prepared for ${prepared.minScore}–${prepared.maxScore}`
|
||||
: 'Current filter off';
|
||||
}
|
||||
|
||||
function PreparedCandidateDetails({
|
||||
candidate,
|
||||
currentTargeting,
|
||||
}: {
|
||||
candidate: OutreachCandidate;
|
||||
currentTargeting: PhysiqueTargeting;
|
||||
}) {
|
||||
function PreparedCandidateDetails({ candidate }: { candidate: OutreachCandidate }) {
|
||||
const preparation = candidate.preparation;
|
||||
if (!preparation) return null;
|
||||
const targeting = preparation.physiqueTargeting;
|
||||
@@ -83,7 +61,7 @@ function PreparedCandidateDetails({
|
||||
<div className="candidate-preparation-copy">
|
||||
<div className="candidate-score-grid" aria-label="Preparation scoring">
|
||||
<div><span>Attractiveness</span><strong>{preparation.attractivenessScore === null ? 'Not scored' : `${preparation.attractivenessScore}/100`}</strong><small>Used in the opener prompt</small></div>
|
||||
<div><span>Physique</span><strong>{preparation.physiqueScore === null ? 'Not scorable' : `${preparation.physiqueScore}/10`}</strong><small>{targetingLabel(currentTargeting, targeting)}</small></div>
|
||||
<div><span>Physique</span><strong>{preparation.physiqueScore === null ? 'Not scorable' : `${preparation.physiqueScore}/10`}</strong><small>{targeting?.enabled ? `Current target ${targeting.minScore}–${targeting.maxScore}` : 'Current filter off'}</small></div>
|
||||
<div><span>Detected gender</span><strong>{preparation.detectedGender}</strong><small>Image analysis</small></div>
|
||||
</div>
|
||||
<div className="candidate-preparation-metadata">
|
||||
@@ -106,15 +84,7 @@ function PreparedCandidateDetails({
|
||||
);
|
||||
}
|
||||
|
||||
function CandidateCard({
|
||||
candidate,
|
||||
currentTargeting,
|
||||
now,
|
||||
}: {
|
||||
candidate: OutreachCandidate;
|
||||
currentTargeting: PhysiqueTargeting;
|
||||
now: number;
|
||||
}) {
|
||||
function CandidateCard({ candidate, now }: { candidate: OutreachCandidate; now: number }) {
|
||||
const waitingUntil = candidate.availableAt > now;
|
||||
const isKnownStatus = KNOWN_STATUSES.has(candidate.status);
|
||||
return (
|
||||
@@ -144,7 +114,7 @@ function CandidateCard({
|
||||
</div>
|
||||
{candidate.note ? <p className="candidate-note"><strong>Latest note</strong>{candidate.note}</p> : null}
|
||||
{candidate.owner ? <AccountOwnerBadge owner={candidate.owner} /> : null}
|
||||
<PreparedCandidateDetails candidate={candidate} currentTargeting={currentTargeting} />
|
||||
<PreparedCandidateDetails candidate={candidate} />
|
||||
</article>
|
||||
</li>
|
||||
);
|
||||
@@ -230,14 +200,7 @@ export function OutreachPage() {
|
||||
<div className="empty-state panel"><strong>The active queue is clear.</strong><span>New potential posts will appear here as discovery finds them.</span></div>
|
||||
) : (
|
||||
<ol aria-label="Active outreach candidates" className="outreach-candidates">
|
||||
{data.candidates.map((candidate) => (
|
||||
<CandidateCard
|
||||
candidate={candidate}
|
||||
currentTargeting={data.physiqueTargeting}
|
||||
key={candidate.postId}
|
||||
now={now}
|
||||
/>
|
||||
))}
|
||||
{data.candidates.map((candidate) => <CandidateCard candidate={candidate} key={candidate.postId} now={now} />)}
|
||||
</ol>
|
||||
)}
|
||||
</section>
|
||||
|
||||
Reference in new issue
Block a user