Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com>
This commit is contained in:
gpt-engineer-app[bot]
2026-04-18 07:10:31 +00:00
co-authored by renee-png
parent 1cc2e9366d
commit e08df7b15a
+7
View File
@@ -42,6 +42,13 @@ function CollectionsIndexPage() {
const [loading, setLoading] = useState(true);
const [search, setSearch] = useState("");
const [stageFilter, setStageFilter] = useState<string>("all");
const [sortKey, setSortKey] = useState<"homeowner" | "case" | "stage" | "tasks" | "opened" | "balance">("opened");
const [sortDir, setSortDir] = useState<"asc" | "desc">("desc");
const toggleSort = (key: typeof sortKey) => {
if (sortKey === key) setSortDir((d) => (d === "asc" ? "desc" : "asc"));
else { setSortKey(key); setSortDir("asc"); }
};
const load = async () => {
setLoading(true);