Revamped the statistical page to work with the new entity system, along with some other improvements to it
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
import {useState, useMemo} from "react";
|
||||
import { useState, useMemo } from "react";
|
||||
import Input from "@/components/Low/Input";
|
||||
import {search} from "@/utils/search";
|
||||
import { search } from "@/utils/search";
|
||||
|
||||
export function useListSearch<T>(fields: string[][], rows: T[]) {
|
||||
export function useListSearch<T>(fields: string[][], rows: T[], placeholder?: string) {
|
||||
const [text, setText] = useState("");
|
||||
|
||||
const renderSearch = () => <Input type="text" name="search" onChange={setText} placeholder="Enter search text" value={text} />;
|
||||
const renderSearch = () =>
|
||||
<Input type="text" name="search" onChange={setText} placeholder={placeholder || "Enter search text"} value={text} />;
|
||||
|
||||
const updatedRows = useMemo(() => {
|
||||
if (text.length > 0) return search(text, fields, rows);
|
||||
|
||||
Reference in New Issue
Block a user