Skip to content

Commit

Permalink
del memo
Browse files Browse the repository at this point in the history
  • Loading branch information
levil664 committed Jul 1, 2024
1 parent 69427c9 commit 4b60ecd
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions apps/schools/domains/common/components/bubbleFilter/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,7 @@ import styles from './styles/styles.module.scss'
import { BubbleFilterProps, BubbleFilterListItem } from '@domains/common/components/bubbleFilter/interface'
import { CloseOutlined } from '@ant-design/icons'

export const BubbleFilter: React.FC<BubbleFilterProps> = React.memo(({ text, items }) => {
const [selectedStatuses, setSelectedStatuses] = useState<string[]>([])

useEffect(() => {
const storedStatuses = localStorage.getItem('selectedStatuses')
if (storedStatuses) {
setSelectedStatuses(JSON.parse(storedStatuses))
}
}, [])

useEffect(() => {
localStorage.setItem('selectedStatuses', JSON.stringify(selectedStatuses))
}, [selectedStatuses])

export const BubbleFilter: React.FC<BubbleFilterProps> = ({ text, items }) => {
const listItems = items.map((item: BubbleFilterListItem) =>
item.count && item.count > 0 ? (
<Row
Expand All @@ -43,4 +30,4 @@ export const BubbleFilter: React.FC<BubbleFilterProps> = React.memo(({ text, ite
{listItems}
</Row>
)
})
}

0 comments on commit 4b60ecd

Please sign in to comment.