mirror of
https://github.com/fsolla/teqo.git
synced 2026-11-13 15:13:07 +00:00
Extrai isListPath + normalizePathname exportados em campaignQuickActionPaths.ts e migra os 9 wrappers (7 públicos + 2 privados) + a 3a cópia de normalize em campaignPageChrome.ts. Refactor estrutural sem mudança de comportamento; derivação de regex de detalhe numérico adiada (gatilho: 3o vertical [id]). Inclui docs/plans/escala-dry-pos-acoes-rapidas-impl.md e o fix de format pré-existente de docs/plans/liderancas-coluna-municipios.md (bloqueava format:check).
26 lines
1.1 KiB
TypeScript
26 lines
1.1 KiB
TypeScript
import { CAMPAIGN_CONCEPTS_PATH } from '@/lib/campaignIntelligenceConcepts'
|
|
import { CAMPAIGN_PROFILE_HOME } from '@/lib/campaignPaths'
|
|
import type { CampaignQuickActionContext } from '@/lib/campaignQuickActionContext'
|
|
import { isListPath } from '@/lib/campaignQuickActionPaths'
|
|
import type { CampaignQuickAction } from '@/lib/campaignQuickActionTypes'
|
|
import { isStaffCampaignRole, type CampaignRole } from '@/lib/campaignRoles'
|
|
|
|
export const isConceptsPath = (pathname: string): boolean =>
|
|
isListPath(pathname, CAMPAIGN_CONCEPTS_PATH)
|
|
|
|
export const isProfilePath = (pathname: string): boolean =>
|
|
isListPath(pathname, CAMPAIGN_PROFILE_HOME)
|
|
|
|
/** B90 — reference/account surfaces with search-only drawer (no action catalog). */
|
|
export const isReferenceQuickActionPath = (pathname: string): boolean =>
|
|
isConceptsPath(pathname) || isProfilePath(pathname)
|
|
|
|
export const resolveReferenceQuickActionsForPath = (
|
|
pathname: string,
|
|
role: CampaignRole,
|
|
_context: CampaignQuickActionContext,
|
|
): readonly CampaignQuickAction[] => {
|
|
if (!isStaffCampaignRole(role)) return []
|
|
if (!isReferenceQuickActionPath(pathname)) return []
|
|
return []
|
|
}
|