Skip to content

Commit

Permalink
feat(input): format filter modal types
Browse files Browse the repository at this point in the history
  • Loading branch information
AbdulWahab3181 committed Jul 31, 2024
1 parent f79f8ba commit fa8e13c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/App/SideBar/FilterSearch/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ export const FilterSearch = ({ showAllSchemas, setShowAllSchemas, schemaAll, anc
})
}

const formatType = (type: string) => type.replace(/_/g, ' ').replace(/\b\w/g, (char) => char.toUpperCase())

return (
<SearchFilterPopover
anchorEl={anchorEl}
Expand Down Expand Up @@ -78,7 +80,7 @@ export const FilterSearch = ({ showAllSchemas, setShowAllSchemas, schemaAll, anc
isSelected={selectedTypes.includes(schema.type as string)}
onClick={() => handleSchemaTypeClick(schema?.type as string)}
>
{schema.type}
{formatType(schema.type ?? '')}
</SchemaType>
))}
</SchemaTypeWrapper>
Expand Down

0 comments on commit fa8e13c

Please sign in to comment.