mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
feat(web): add Maintainers column
This commit is contained in:
parent
5f0bfa56e6
commit
3baaa25866
2 changed files with 23 additions and 0 deletions
|
|
@ -93,4 +93,24 @@ export const columns = [
|
|||
) : null;
|
||||
},
|
||||
}),
|
||||
columnHelper.accessor((row) => row.maintainerIds, {
|
||||
header: "Maintainers",
|
||||
cell: (info) => {
|
||||
const meta = info.table.options.meta as FilterListsTableMeta;
|
||||
const maintainers =
|
||||
info.getValue()?.flatMap((id) => {
|
||||
const maintainer = meta.maintainers.find((s) => s.id === id);
|
||||
return maintainer
|
||||
? [
|
||||
{
|
||||
key: maintainer.id,
|
||||
value: maintainer.name,
|
||||
href: maintainer.url ?? undefined,
|
||||
},
|
||||
]
|
||||
: [];
|
||||
}) ?? [];
|
||||
return <BadgeCloud items={maintainers} />;
|
||||
},
|
||||
}),
|
||||
];
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ import { Tag } from "@/services/get-tags";
|
|||
export interface FilterListsTableMeta extends TableMeta<FilterList> {
|
||||
languages: readonly Language[];
|
||||
licenses: readonly License[];
|
||||
maintainers: readonly Maintainer[];
|
||||
syntaxes: readonly Syntax[];
|
||||
tags: readonly Tag[];
|
||||
}
|
||||
|
|
@ -50,6 +51,7 @@ export function FilterListTable({
|
|||
initialFilterLists,
|
||||
languages,
|
||||
licenses,
|
||||
maintainers,
|
||||
syntaxes,
|
||||
tags,
|
||||
}: FilterListTableProps) {
|
||||
|
|
@ -75,6 +77,7 @@ export function FilterListTable({
|
|||
meta: {
|
||||
languages,
|
||||
licenses,
|
||||
maintainers,
|
||||
syntaxes,
|
||||
tags,
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue