B121 — format

This commit is contained in:
Cursor Agent 2026-08-02 00:57:11 +00:00
parent 9d8dcbbea4
commit bf042c3217
No known key found for this signature in database
2 changed files with 19 additions and 9 deletions

View file

@ -8,21 +8,21 @@ import {
updateLeadershipWizard,
} from '@/app/(campaign)/campanha/actions/leadership'
import { declareVotes } from '@/app/(campaign)/campanha/actions/votePledge'
import { WIZARD_LEADERSHIP_VOTES_SAVED } from '@/lib/campaignWizardCopy'
import {
optionalFormText,
requiredFormText,
requiredIntegerFormValue,
requiredRelationshipFormValue,
} from '@/lib/formData'
import { MAX_VOTE_COUNT } from '@/lib/schemas/primitives'
import { WIZARD_LEADERSHIP_VOTES_SAVED } from '@/lib/campaignWizardCopy'
import { VOTE_PLEDGE_DECLARE_SAFE_MESSAGES } from '@/lib/schemas/votePledge'
import {
LEADERSHIP_DUPLICATE_MESSAGE,
LEADERSHIP_INVALID_CONTACT_MESSAGE,
LEADERSHIP_MUNICIPALITY_SCOPE_MESSAGE,
isSupportStatus,
} from '@/lib/schemas/leadership'
import { MAX_VOTE_COUNT } from '@/lib/schemas/primitives'
import { VOTE_PLEDGE_DECLARE_SAFE_MESSAGES } from '@/lib/schemas/votePledge'
import {
runCampaignFormAction,
type CampaignFormActionState,

View file

@ -2,11 +2,19 @@
import { CheckIcon, InfoIcon, PlusIcon, TriangleAlertIcon } from 'lucide-react'
import { useRouter } from 'next/navigation'
import { useActionState, useCallback, useEffect, useMemo, useRef, useState, useTransition } from 'react'
import {
useActionState,
useCallback,
useEffect,
useMemo,
useRef,
useState,
useTransition,
} from 'react'
import { toast } from 'sonner'
import type { LeadershipListSupportStatusResponse } from '@/app/(campaign)/campanha/(app)/liderancas/support-status/types'
import { declareVotesWizardFormAction } from '@/app/(campaign)/campanha/(app)/acoes/wizardLeadershipFormActions'
import type { LeadershipListSupportStatusResponse } from '@/app/(campaign)/campanha/(app)/liderancas/support-status/types'
import { SupportStatusBadge } from '@/components/campaign/leadership/SupportStatusBadge'
import { WizardLeadershipForm } from '@/components/campaign/leadership/WizardLeadershipForm'
import { CampaignFormActionMessage } from '@/components/campaign/shared/CampaignFormActionMessage'
@ -54,8 +62,6 @@ import {
type SupportStatus,
} from '@/lib/schemas/leadership'
import { cn } from '@/lib/utils'
import { fieldError } from '@/utilities/campaignFormFields'
import { supportStatusLabels } from '@/utilities/leadership/leadershipLabels'
import {
resolveWizardChainEntry,
wizardChainContinueHref,
@ -66,6 +72,8 @@ import {
resolveWizardLeadershipSkip,
type WizardLeadershipTileViewModel,
} from '@/lib/wizardLeadershipContract'
import { fieldError } from '@/utilities/campaignFormFields'
import { supportStatusLabels } from '@/utilities/leadership/leadershipLabels'
const SUPPORT_STATUS_ENDPOINT = '/campanha/liderancas/support-status'
const DEFAULT_STATUS: SupportStatus = 'a_abordar'
@ -91,8 +99,10 @@ const notesLabel = (notes: string | null): string =>
const secondaryContact = (tile: WizardLeadershipTileViewModel): string | null =>
tile.phone?.trim() || tile.email?.trim() || null
const drawerContextLabel = (tile: WizardLeadershipTileViewModel, municipalityName: string): string =>
`${tile.name} · ${municipalityName}`
const drawerContextLabel = (
tile: WizardLeadershipTileViewModel,
municipalityName: string,
): string => `${tile.name} · ${municipalityName}`
export const WizardLeadershipStep = ({
actionSlug,