diff --git a/src/app/(campaign)/campanha/(app)/acoes/wizardLeadershipFormActions.ts b/src/app/(campaign)/campanha/(app)/acoes/wizardLeadershipFormActions.ts index 668eeb9f..8d8ee7ac 100644 --- a/src/app/(campaign)/campanha/(app)/acoes/wizardLeadershipFormActions.ts +++ b/src/app/(campaign)/campanha/(app)/acoes/wizardLeadershipFormActions.ts @@ -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, diff --git a/src/components/campaign/leadership/WizardLeadershipStep.tsx b/src/components/campaign/leadership/WizardLeadershipStep.tsx index 3779b413..f40d272d 100644 --- a/src/components/campaign/leadership/WizardLeadershipStep.tsx +++ b/src/components/campaign/leadership/WizardLeadershipStep.tsx @@ -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,