diff --git a/app/[locale]/(protected)/curator/feedback/page.tsx b/app/[locale]/(protected)/curator/feedback/page.tsx new file mode 100644 index 00000000..5986ffc6 --- /dev/null +++ b/app/[locale]/(protected)/curator/feedback/page.tsx @@ -0,0 +1,95 @@ +"use client"; +import SiteBreadcrumb from "@/components/site-breadcrumb"; +import { Progress } from "@/components/ui/progress"; +import { getUserFeedbacks } from "@/service/master/faq"; +import { Icon } from "@iconify/react/dist/iconify.js"; +import { stringify } from "querystring"; +import { useEffect, useState } from "react"; + +export default function UserFeedback() { + const [listData, setListData] = useState([]); + + useEffect(() => { + initState(); + }, []); + async function initState() { + const response = await getUserFeedbacks(); + console.log("ssss", response?.data?.data); + setListData(response?.data?.data); + } + + const renderStar = (count: number) => { + const mapped = [1, 2, 3, 4, 5]; + return ( +
+ {mapped?.map((row) => + row < count + 1 ? ( + + ) : ( + + ) + )} +
+ ); + }; + return ( +
+ +
+

Hasil Feedback

+
+ {listData?.map( + (list: any) => + list?.avgScore !== "NaN" && ( +
+
+

{parseInt(list?.avgScore)}

+ {renderStar(parseInt(list?.avgScore))} +
+

{list?.question}

+
+

Penilaian 5

+ +
+
+

Penilaian 4

+ +
+
+

Penilaian 3

+ +
+
+

Penilaian 2

+ +
+
+

Penilaian 1

+ +
+
+ ) + )} +
+
+
+ ); +} diff --git a/app/[locale]/(protected)/shared/communication/collaboration/detail/[id]/page.tsx b/app/[locale]/(protected)/shared/communication/collaboration/detail/[id]/page.tsx index 73d182c9..9d755830 100644 --- a/app/[locale]/(protected)/shared/communication/collaboration/detail/[id]/page.tsx +++ b/app/[locale]/(protected)/shared/communication/collaboration/detail/[id]/page.tsx @@ -69,7 +69,10 @@ export default function CollaborationPage() { loading(); const response = await deleteCollabDiscussion(dataId); console.log(response); - + toast({ + title: "Sukses hapus", + }); + setReplyValue(""); close(); initState(); } @@ -79,7 +82,7 @@ export default function CollaborationPage() { loading(); const data = { ticketId: id, - replyValue, + message: replyValue, parentId: null, }; diff --git a/app/[locale]/(protected)/shared/communication/escalation/components/columns.tsx b/app/[locale]/(protected)/shared/communication/escalation/components/columns.tsx index a8af3677..753f3e80 100644 --- a/app/[locale]/(protected)/shared/communication/escalation/components/columns.tsx +++ b/app/[locale]/(protected)/shared/communication/escalation/components/columns.tsx @@ -100,14 +100,6 @@ const columns: ColumnDef[] = [ View - - - Edit - - - - Delete - ); diff --git a/components/form/communication/escalation-detail-form.tsx b/components/form/communication/escalation-detail-form.tsx index 43c17abd..bcddc3ec 100644 --- a/components/form/communication/escalation-detail-form.tsx +++ b/components/form/communication/escalation-detail-form.tsx @@ -26,6 +26,8 @@ import { saveTicketInternalReply, } from "@/service/communication/communication"; import { Textarea } from "@/components/ui/textarea"; +import { Icon } from "@iconify/react/dist/iconify.js"; +import { Link } from "@/i18n/routing"; const taskSchema = z.object({ title: z.string().min(1, { message: "Judul diperlukan" }), @@ -34,33 +36,6 @@ const taskSchema = z.object({ }), }); -export type escalationDetail = { - id: number; - title: string; - createdAt: string; - commentFromUserName: string; - message: string; - createdBy: { - id: number; - fullname: string; - }; - sendTo: { - id: number; - fullname: string; - }; - status: { - id: number; - name: string; - }; - priority: { - id: number; - name: string; - }; - description: string; - narration: string; - is_active: string; -}; - export type replyDetail = { id: number; message: string; @@ -79,7 +54,7 @@ export default function FormDetailEscalation() { const MySwal = withReactContent(Swal); const { id } = useParams() as { id: string }; - const [detail, setDetail] = useState(); + const [detail, setDetail] = useState(); const [ticketReply, setTicketReply] = useState([]); const [replyVisible, setReplyVisible] = useState(false); const [replyMessage, setReplyMessage] = useState(""); @@ -165,121 +140,134 @@ export default function FormDetailEscalation() { }; return ( - -
-
-
- {detail !== undefined && ( -
-

- Ticket #{detail.id} -

-
- - - -
-

- - {detail?.commentFromUserName} - {" "} - mengirimkan pesan untuk{" "} - {detail?.message} -

-

{detail?.createdAt}

-
+
+
+
+ {detail !== undefined && ( +
+

+ Ticket #{detail.id} +

+
+ + +
+

+ + {detail?.commentFromUserName} + + {` `} + mengirimkan pesan untuk{` `} + + {detail?.message} + +

+

+ {`${new Date(detail?.createdAt).getDate()}-${ + new Date(detail?.createdAt).getMonth() + 1 + }-${new Date(detail?.createdAt).getFullYear()} ${new Date( + detail?.createdAt + ).getHours()}:${new Date(detail?.createdAt).getMinutes()}`} +

-

{detail.message}

- )} +

{detail.message}

+
+ )} +
+
+ {detail !== undefined && ( +
+
+ + ( + + )} + /> + {/* {errors.title?.message && ( +

+ {errors.title.message} +

+ )} */} +
+
+ + +
+
+ + ( +