mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
feat(web): ✨ re-enable syntax column filter
This commit is contained in:
parent
6801e48dcc
commit
cecf44a8ec
1 changed files with 17 additions and 14 deletions
|
|
@ -29,6 +29,7 @@ import { arraySorter } from "./arraySorter";
|
|||
import { nameof } from "../../utils";
|
||||
import styles from "./ListsTable.module.css";
|
||||
import { TablePaginationConfig } from "antd/lib/table";
|
||||
import { SyntaxTag } from "../SyntaxTag";
|
||||
|
||||
interface Props {
|
||||
lists: List[];
|
||||
|
|
@ -192,20 +193,22 @@ export const ListsTable = (props: RouteComponentProps & Props) => {
|
|||
sorter={(a, b) => arraySorter(a.syntaxIds, b.syntaxIds, syntaxes)}
|
||||
width={254}
|
||||
className={styles.nogrow}
|
||||
// filters={syntaxes.map((s) => ({
|
||||
// text: (
|
||||
// <>
|
||||
// <SyntaxTag name={s.name} showLabel={false} />(
|
||||
// {
|
||||
// visibleLists.filter(
|
||||
// (l) => l.syntaxIds && l.syntaxIds === s.id
|
||||
// ).length
|
||||
// }
|
||||
// )
|
||||
// </>
|
||||
// ),
|
||||
// value: s.id.toString(),
|
||||
// }))}
|
||||
filters={syntaxes.map((s) => ({
|
||||
text: (
|
||||
<>
|
||||
<SyntaxTag name={s.name} showLabel={false} />
|
||||
|
||||
{s.name} (
|
||||
{
|
||||
visibleLists.filter(
|
||||
(li) => li.syntaxIds && li.syntaxIds.includes(s.id)
|
||||
).length
|
||||
}
|
||||
)
|
||||
</>
|
||||
),
|
||||
value: s.id.toString(),
|
||||
}))}
|
||||
onFilter={(value, record) =>
|
||||
record.syntaxIds ? record.syntaxIds.toString() === value : false
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue