Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/components/tools/CampaignBuilderRunner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ const CAMPAIGN_TYPES: { value: CampaignType; label: string; description: string
},
];

// Bolt optimization: Map campaign types by value for O(1) label lookups
const CAMPAIGN_TYPE_MAP = new Map(CAMPAIGN_TYPES.map((c) => [c.value, c]));

const TARGETING_TYPES: { value: TargetingType; label: string }[] = [
{ value: 'MANUAL', label: 'Manual' },
{ value: 'AUTO', label: 'Auto' },
Expand Down Expand Up @@ -307,7 +310,7 @@ export function CampaignBuilderRunner({ sessionId, scenario, toolSlug }: Campaig
</CardHeader>
<p className={styles.allowedNote}>
<strong>Allowed campaign types:</strong>{' '}
{allowedTypes.map((t) => CAMPAIGN_TYPES.find((c) => c.value === t)?.label ?? t).join(' · ')}
{allowedTypes.map((t) => CAMPAIGN_TYPE_MAP.get(t)?.label ?? t).join(' · ')}
<br />
<strong>Allowed bid strategies:</strong> {allowedStrategies.join(' · ')}
</p>
Expand Down
Loading