fix(campanha): B133 typecheck — optional catalog subtitle + chrome component return
Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
This commit is contained in:
parent
f89fc4b81f
commit
6cc17f0d4e
2 changed files with 4 additions and 2 deletions
|
|
@ -15,7 +15,7 @@ const IGNORED_PARAMS = ['page']
|
|||
* When the current URL matches a saved municipality filter, the filter name
|
||||
* becomes the page subtitle (B133) — the bar keeps chips as the editable recorte.
|
||||
*/
|
||||
export const MunicipalityListPageChrome = (): null => {
|
||||
export const MunicipalityListPageChrome = () => {
|
||||
const savedFilters = useMunicipalitySavedFilters()
|
||||
const pathname = usePathname()
|
||||
const searchParams = useSearchParams()
|
||||
|
|
|
|||
|
|
@ -97,7 +97,9 @@ const resolveCatalogEntry = (
|
|||
entry: (typeof campaignPageChromeCatalog)[keyof typeof campaignPageChromeCatalog],
|
||||
): CampaignPageChrome | null => {
|
||||
if (!entry) return null
|
||||
return { title: entry.title, subtitle: entry.subtitle }
|
||||
return 'subtitle' in entry && entry.subtitle
|
||||
? { title: entry.title, subtitle: entry.subtitle }
|
||||
: { title: entry.title }
|
||||
}
|
||||
|
||||
const sectionOnly = (title: string): CampaignPageChrome => ({ title })
|
||||
|
|
|
|||
Loading…
Reference in a new issue