feat(feedback): Add feedback view for companies and customers
This commit introduces the ability to view feedback associated with specific companies and customers directly from their respective tables. To support this, the `TenderFeedbackTable` has been refactored into a more generic `FeedbackTable` component. This new component accepts a `paramKey` prop (e.g., "tender_id", "company_id") to filter feedback for different entities. A new feedback icon has been added to the actions column in both the Companies and Customers tables, providing a direct link to the feedback page for each entry.
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
"use client";
|
||||
import Breadcrumb from "@/components/Breadcrumbs/Breadcrumb";
|
||||
import FeedbackTable from "@/components/Tables/feedback-table";
|
||||
|
||||
import { BreadcrumbItem } from "@/types/shared";
|
||||
import { use } from "react";
|
||||
interface IProps {
|
||||
params: Promise<{
|
||||
id: string;
|
||||
}>;
|
||||
}
|
||||
|
||||
const TenderFeedbackPage = ({ params }: IProps) => {
|
||||
const { id } = use(params);
|
||||
|
||||
const breadcrumbItems: BreadcrumbItem[] = [
|
||||
{ href: "/", name: "Dashboard" },
|
||||
{ href: "/companies", name: "Companies" },
|
||||
{ href: `/companies/feedback/${id}`, name: "Companies feedback" },
|
||||
];
|
||||
return (
|
||||
<>
|
||||
<Breadcrumb items={breadcrumbItems} />
|
||||
<FeedbackTable paramKey="company_id" id={id} />
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default TenderFeedbackPage;
|
||||
@@ -0,0 +1,29 @@
|
||||
"use client";
|
||||
import Breadcrumb from "@/components/Breadcrumbs/Breadcrumb";
|
||||
import FeedbackTable from "@/components/Tables/feedback-table";
|
||||
|
||||
import { BreadcrumbItem } from "@/types/shared";
|
||||
import { use } from "react";
|
||||
interface IProps {
|
||||
params: Promise<{
|
||||
id: string;
|
||||
}>;
|
||||
}
|
||||
|
||||
const TenderFeedbackPage = ({ params }: IProps) => {
|
||||
const { id } = use(params);
|
||||
|
||||
const breadcrumbItems: BreadcrumbItem[] = [
|
||||
{ href: "/", name: "Dashboard" },
|
||||
{ href: "/customers", name: "Customers" },
|
||||
{ href: `/customers/feedback/${id}`, name: "Customers feedback" },
|
||||
];
|
||||
return (
|
||||
<>
|
||||
<Breadcrumb items={breadcrumbItems} />
|
||||
<FeedbackTable paramKey="customer_id" id={id} />
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default TenderFeedbackPage;
|
||||
@@ -1,6 +1,7 @@
|
||||
"use client";
|
||||
import Breadcrumb from "@/components/Breadcrumbs/Breadcrumb";
|
||||
import TenderFeedbackTable from "@/components/Tables/tenders/feedback";
|
||||
import FeedbackTable from "@/components/Tables/feedback-table";
|
||||
|
||||
import { BreadcrumbItem } from "@/types/shared";
|
||||
import { use } from "react";
|
||||
interface IProps {
|
||||
@@ -20,7 +21,7 @@ const TenderFeedbackPage = ({ params }: IProps) => {
|
||||
return (
|
||||
<>
|
||||
<Breadcrumb items={breadcrumbItems} />
|
||||
<TenderFeedbackTable id={id} />
|
||||
<FeedbackTable id={id} paramKey="tender_id" />
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user