feat: consolidar desenvolvimentos do portal InvestMoz
This commit is contained in:
@@ -10,6 +10,10 @@ import type { BusinessVerification } from './business-verifications';
|
||||
import BusinessWizard from './business-wizard';
|
||||
import type { FormSchema } from './business-wizard';
|
||||
import type { Country } from '@/components/country-select';
|
||||
import BusinessPointSummary, {
|
||||
type RegisteredBusinessLocation,
|
||||
} from '@/components/business-point-summary';
|
||||
import { businessPointTerritoryLabel } from '@/lib/business-locations';
|
||||
|
||||
type Props = {
|
||||
countries: Country[];
|
||||
@@ -18,6 +22,8 @@ type Props = {
|
||||
sectors: { id: number; name: string }[];
|
||||
record: Business;
|
||||
canEdit: boolean;
|
||||
registeredLocation?: RegisteredBusinessLocation | null;
|
||||
pointPublicationAvailable?: boolean;
|
||||
owner: boolean;
|
||||
canReview: boolean;
|
||||
canTriage: boolean;
|
||||
@@ -68,6 +74,8 @@ function Editor({
|
||||
verifications,
|
||||
formSchema,
|
||||
sectors,
|
||||
registeredLocation,
|
||||
pointPublicationAvailable,
|
||||
}: Props) {
|
||||
const [payload, setPayload] = useState(record.payload);
|
||||
const [modality, setModality] = useState(record.modality);
|
||||
@@ -131,6 +139,16 @@ function Editor({
|
||||
{businessStates[record.status]} · versão {record.version_no} ·
|
||||
informação reservada
|
||||
</p>
|
||||
<BusinessPointSummary
|
||||
payload={record.payload}
|
||||
registered={registeredLocation}
|
||||
available={pointPublicationAvailable}
|
||||
published={record.status === 'published'}
|
||||
territoryLabel={businessPointTerritoryLabel(
|
||||
record.payload,
|
||||
record.territory_paths,
|
||||
)}
|
||||
/>
|
||||
<p>
|
||||
Informação declarada, pendente de validação. Não constitui
|
||||
anúncio público, certificação, avaliação ou autorização de
|
||||
@@ -148,7 +166,18 @@ function Editor({
|
||||
</div>
|
||||
{Object.entries(formSchema)
|
||||
.filter(
|
||||
([key]) =>
|
||||
([key, field]) =>
|
||||
!key.startsWith('location_point_') &&
|
||||
![
|
||||
'location_latitude',
|
||||
'location_longitude',
|
||||
].includes(key) &&
|
||||
Object.entries(field.when ?? {}).every(
|
||||
([dependency, values]) =>
|
||||
values.includes(
|
||||
record.payload[dependency] ?? '',
|
||||
),
|
||||
) &&
|
||||
![
|
||||
'title',
|
||||
'description',
|
||||
|
||||
Reference in New Issue
Block a user