-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* ✨ Show subject stats/summary * ✨ Show persistent comment on repositories table * ✨ Add clear filter button to filter panel dropdown * ✨ Update version and fix undefined render * ✨ Add sort by account stat * ✨ Add filters for stats * 🚨 Fix linter issues * 🧹 CLeanup * 💄 Fix up stat text
- Loading branch information
Showing
15 changed files
with
746 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import { FormLabel, Input } from '@/common/forms' | ||
import { useQueueFilter } from '../useQueueFilter' | ||
|
||
export const QueueFilterStats = () => { | ||
const { | ||
queueFilters, | ||
setMinAccountSuspendCount, | ||
setMinReportedRecordsCount, | ||
setMinTakendownRecordsCount, | ||
} = useQueueFilter() | ||
|
||
const handleInputChange = | ||
(handler: (val?: number) => void) => | ||
(e: React.ChangeEvent<HTMLInputElement>) => { | ||
const inputValue = e.target.value | ||
if (inputValue === '') { | ||
handler(undefined) | ||
} else if (/^\d*$/.test(inputValue)) { | ||
// Allow only digits by filtering non-numeric characters | ||
handler(Number(inputValue)) | ||
} | ||
} | ||
return ( | ||
<div className="flex flex-row gap-6"> | ||
<div className="px-2 mt-4"> | ||
<div className="flex flex-row gap-2"> | ||
<FormLabel label="Min. Suspension count" className="mb-2"> | ||
<Input | ||
type="number" | ||
className="block w-full" | ||
id="minAccountSuspendCount" | ||
name="minAccountSuspendCount" | ||
value={queueFilters.minAccountSuspendCount || ''} | ||
onChange={handleInputChange(setMinAccountSuspendCount)} | ||
/> | ||
</FormLabel> | ||
<FormLabel label="Min. Reported records"> | ||
<Input | ||
type="number" | ||
className="block w-full" | ||
id="minReportedRecordsCount" | ||
name="minReportedRecordsCount" | ||
value={queueFilters.minReportedRecordsCount || ''} | ||
onChange={handleInputChange(setMinReportedRecordsCount)} | ||
/> | ||
</FormLabel> | ||
</div> | ||
<FormLabel label="Min. Takendown records"> | ||
<Input | ||
type="number" | ||
className="block w-full" | ||
id="minTakendownRecordsCount" | ||
name="minTakendownRecordsCount" | ||
value={queueFilters.minTakendownRecordsCount || ''} | ||
onChange={handleInputChange(setMinTakendownRecordsCount)} | ||
/> | ||
</FormLabel> | ||
</div> | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.