Merge pull request #899 from Tria-plc/freight/feat/fixes-v1

Freight/feat/fixes v1
This commit is contained in:
Nathnael Wondisha
2026-07-22 11:02:11 +03:00
committed by GitHub
41 changed files with 1491 additions and 639 deletions

View File

@@ -81,6 +81,10 @@ const VIEW_FILTERS: Record<
};
const SORT_OPTIONS = [
// Queue ordering: awaiting first approval → pending profile changes → the
// rest, newest first within each group. The default, so whatever marketing
// must act on is always on top of the list.
{ value: "review:DESC", label: "Needs review first" },
{ value: "createdAt:DESC", label: "Newest first" },
{ value: "createdAt:ASC", label: "Oldest first" },
{ value: "name:ASC", label: "Name (AZ)" },
@@ -93,11 +97,11 @@ export default function CustomersPage() {
const [query, setQuery] = useState("");
const [debouncedQuery] = useDebouncedValue(query, 300);
const [view, setView] = useState<CustomerView>("all");
const [sort, setSort] = useState<string>("createdAt:DESC");
const [sort, setSort] = useState<string>("review:DESC");
const filter = useMemo(() => {
const [sortBy, sortOrder] = sort.split(":") as [
"name" | "createdAt" | "updatedAt",
"review" | "name" | "createdAt" | "updatedAt",
"ASC" | "DESC",
];
return {