a8d95d5f92
- Enable Contact Us navigation menu item in sidebar with visible flag set to true - Create TContacts type schema with Zod validation for API responses - Add type safety to contactUsService.getAllContactUs() with return type annotation - Implement contact list table rendering with proper data mapping - Display contact information columns: full name, email, status, phone, created date - Add date formatting using unixToDate utility for created_at timestamps - Update useContactUsListPresenter to return properly structured contacts data - Refactor table columns array to include all contact detail fields - Follows established pattern from recent filtering feature implementations
25 lines
555 B
TypeScript
25 lines
555 B
TypeScript
"use client";
|
|
import { useReadAllContactUs } from "@/hooks/queries/useContactUsQuery";
|
|
import { usePathname, useRouter } from "next/navigation";
|
|
export const useContactUsListPresenter = () => {
|
|
const columns: string[] = [
|
|
"row",
|
|
"Full name",
|
|
"email",
|
|
"status",
|
|
"phone",
|
|
"created at",
|
|
"actions",
|
|
];
|
|
const pathname = usePathname();
|
|
const router = useRouter();
|
|
const { data, isPending } = useReadAllContactUs();
|
|
return {
|
|
columns,
|
|
pathname,
|
|
router,
|
|
isPending,
|
|
contacts: data?.data.contacts,
|
|
};
|
|
};
|