mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 16:59:12 +00:00
feature: clickable filter link (#81)
This commit is contained in:
parent
47031358b0
commit
dbf7ce0deb
3 changed files with 19 additions and 1 deletions
|
@ -401,6 +401,12 @@ export function ReleaseCell({ value, column, row }: any) {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function IndexerCell({ value, column, row }: any) {
|
||||||
|
return (
|
||||||
|
<div className="text-sm font-medium text-gray-900 dark:text-gray-500" title={value}>{value}</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
function Table({ columns, data }: any) {
|
function Table({ columns, data }: any) {
|
||||||
// Use the state and functions returned from useTable to build your UI
|
// Use the state and functions returned from useTable to build your UI
|
||||||
const {
|
const {
|
||||||
|
@ -668,6 +674,7 @@ function DataTablee() {
|
||||||
{
|
{
|
||||||
Header: "Indexer",
|
Header: "Indexer",
|
||||||
accessor: 'indexer',
|
accessor: 'indexer',
|
||||||
|
Cell: IndexerCell,
|
||||||
Filter: SelectColumnFilter, // new
|
Filter: SelectColumnFilter, // new
|
||||||
filter: 'includes',
|
filter: 'includes',
|
||||||
},
|
},
|
||||||
|
|
|
@ -145,6 +145,12 @@ export function ReleaseStatusCell({ value, column, row }: ReleaseStatusCellProps
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function IndexerCell({ value, column, row }: any) {
|
||||||
|
return (
|
||||||
|
<div className="text-sm font-medium text-gray-900 dark:text-gray-500" title={value}>{value}</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
const initialState = {
|
const initialState = {
|
||||||
queryPageIndex: 0,
|
queryPageIndex: 0,
|
||||||
queryPageSize: 10,
|
queryPageSize: 10,
|
||||||
|
@ -202,6 +208,7 @@ function Table() {
|
||||||
{
|
{
|
||||||
Header: "Indexer",
|
Header: "Indexer",
|
||||||
accessor: 'indexer',
|
accessor: 'indexer',
|
||||||
|
Cell: IndexerCell,
|
||||||
Filter: SelectColumnFilter, // new
|
Filter: SelectColumnFilter, // new
|
||||||
filter: 'includes',
|
filter: 'includes',
|
||||||
},
|
},
|
||||||
|
|
|
@ -155,7 +155,11 @@ function FilterListItem({ filter, idx }: FilterListItemProps) {
|
||||||
/>
|
/>
|
||||||
</Switch>
|
</Switch>
|
||||||
</td>
|
</td>
|
||||||
<td className="px-6 py-4 w-full whitespace-nowrap text-sm font-medium text-gray-900 dark:text-gray-100">{filter.name}</td>
|
<td className="px-6 w-full whitespace-nowrap text-sm font-medium text-gray-900 dark:text-gray-100">
|
||||||
|
<Link to={`filters/${filter.id.toString()}`} className="dark:hover:text-gray-400 w-full py-4 flex">
|
||||||
|
{filter.name}
|
||||||
|
</Link>
|
||||||
|
</td>
|
||||||
<td className="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">{filter.indexers && filter.indexers.map(t =>
|
<td className="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">{filter.indexers && filter.indexers.map(t =>
|
||||||
<span key={t.id} className="mr-2 inline-flex items-center px-2.5 py-0.5 rounded-md text-sm font-medium bg-gray-100 dark:bg-gray-800 text-gray-800 dark:text-gray-400">{t.name}</span>)}</td>
|
<span key={t.id} className="mr-2 inline-flex items-center px-2.5 py-0.5 rounded-md text-sm font-medium bg-gray-100 dark:bg-gray-800 text-gray-800 dark:text-gray-400">{t.name}</span>)}</td>
|
||||||
<td className="px-6 py-4 whitespace-nowrap text-right text-sm font-medium">
|
<td className="px-6 py-4 whitespace-nowrap text-right text-sm font-medium">
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue