- {isLoading && (
-
-
-
- )}
- {_.isEmpty(data) ? (
-
- ) : (
- data.map((e, i) => (
-
- {userLoginId === e?.User?.id ? (
-
-
-
-
- {e.User.Profile.name}
-
-
+
+
+ {/* Header */}
+
-
-
- {new Intl.DateTimeFormat("id-ID", {
- timeStyle: "medium",
- }).format(e.createdAt)}
-
-
-
- {new Intl.DateTimeFormat("id-ID", {
- dateStyle: "medium",
- }).format(e.createdAt)}
-
-
-
-
-
- ) : (
-
-
-
-
- {e.User.Profile.name}
-
-
-
-
- {new Intl.DateTimeFormat("id-ID", {
- timeStyle: "medium",
- }).format(e.createdAt)}
-
-
-
- {new Intl.DateTimeFormat("id-ID", {
- dateStyle: "medium",
- }).format(e.createdAt)}
-
-
-
-
-
+ {/* Main View */}
+
+ {/* Chat View */}
+ {_.isEmpty(data) ? (
+
+ ) : (
+ // --- Main component --- //
+
+ (
+
+
+
)}
-
- ))
+ data={data}
+ setData={setData}
+ moreData={async () => {
+ let loadData = await colab_getMessageByRoomId({
+ roomId: roomId,
+ page: 1,
+ });
+ setActivePage((val) => val + 1);
+
+ return loadData;
+ }}
+ >
+ {(item) => (
+ {item.message}
+ //
+ // {userLoginId === item?.User?.id ? (
+ //
+ //
+ //
+ //
+ // {item?.User?.Profile?.name}
+ //
+ //
+ //
+ //
+ //
+ // ) : (
+ //
+ //
+ //
+ //
+ // {item?.User?.Profile?.name}
+ //
+ //
+ //
+ //
+ //
+ // )}
+ //
+ )}
+
+
)}
- {/* {isLoading && (
+
+
+ {/* Footer */}
+
+
+
+ >
+ );
+}
+
+function HeaderGrup({
+ selectRoom,
+}: {
+ selectRoom: MODEL_COLLABORATION_ROOM_CHAT;
+}) {
+ const router = useRouter();
+ const [loadingBack, setLoadingBack] = useState(false);
+ const [loadingInfo, setLoadingInfo] = useState(false);
+ return (
+ <>
+
+
+
+
+ {
+ setLoadingBack(true);
+ router.back();
+ }}
+ >
+ {loadingBack ? (
+
+ ) : (
+
+ )}
+
+
+
-
+
+ {selectRoom?.name}
+
- )} */}
-
+
+