Skip to content

Commit eb75abc

Browse files
Merge branch 'main' into codingsh/add-transactions-types
2 parents a79aa1c + fd07aeb commit eb75abc

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

components/Reference/columns.tsx

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
import { Row } from 'react-table'
22
import { StackBox } from 'components/ui'
33

4-
const filter = (rows: Row[], id: string, filterValue: string) => {
5-
const re = new RegExp(`${filterValue}`, 'i')
6-
return rows.filter((row: any) => {
7-
const value = row.original[id] // Ensure row.original[id] exists
8-
return value && value.match(re)
9-
})
4+
5+
// Possible fields are defined in `Opcodes.json`
6+
type OpcodeRow = Row<Record<string, string | undefined>>
7+
8+
const filter = (rows: OpcodeRow[], id: string, filterValue: string) => {
9+
return rows.filter((row) =>
10+
row.original[id]
11+
?.toLocaleLowerCase()
12+
.includes(filterValue.toLocaleLowerCase()),
13+
)
1014
}
1115

1216
const columns = (isPrecompiled: boolean, isTransactionType: boolean = false) => {

0 commit comments

Comments
 (0)