mirror of
https://github.com/fsolla/teqo.git
synced 2026-11-15 18:53:06 +00:00
Após salvar (ou Pular) votos/tendência/sinal/liderança, navega ao próximo elo da matriz v1 no mesmo município via entryAction, em vez de voltar ao Início. Helper puro wizardActionChain + skips alinhados. Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
40 lines
1.3 KiB
TypeScript
40 lines
1.3 KiB
TypeScript
import type { CampaignWizardActionId } from '@/lib/campaignActionRoutes'
|
|
import { WIZARD_LEADERSHIP_SKIP_LABEL } from '@/lib/campaignWizardCopy'
|
|
import type { SupportStatus } from '@/lib/schemas/leadership'
|
|
import { resolveWizardChainEntry, wizardChainContinueHref } from '@/lib/wizardActionChain'
|
|
|
|
/** Client-safe tile payload for the B70 leadership wizard grid. */
|
|
export type WizardLeadershipTileViewModel = {
|
|
id: number
|
|
name: string
|
|
phone: string | null
|
|
email: string | null
|
|
supportStatus: SupportStatus | null
|
|
exclusive: boolean
|
|
notes: string | null
|
|
}
|
|
|
|
export type WizardLeadershipSkipAction = {
|
|
label: string
|
|
href: string
|
|
}
|
|
|
|
export const showLeadershipWizardSkip = (entryAction?: CampaignWizardActionId): boolean => {
|
|
const effectiveEntry = entryAction ?? 'update-leadership'
|
|
return effectiveEntry !== 'update-leadership'
|
|
}
|
|
|
|
export const resolveWizardLeadershipSkip = (
|
|
entryAction: CampaignWizardActionId | undefined,
|
|
municipalitySlug: string,
|
|
): WizardLeadershipSkipAction | undefined =>
|
|
showLeadershipWizardSkip(entryAction)
|
|
? {
|
|
label: WIZARD_LEADERSHIP_SKIP_LABEL,
|
|
href: wizardChainContinueHref(
|
|
resolveWizardChainEntry(entryAction, 'update-leadership'),
|
|
'update-leadership',
|
|
municipalitySlug,
|
|
),
|
|
}
|
|
: undefined
|