basic conv display + fetch messages fnc
This commit is contained in:
40
src/components/widget/chatWidget.jsx
Normal file
40
src/components/widget/chatWidget.jsx
Normal file
@@ -0,0 +1,40 @@
|
||||
import { useHotel } from "../HotelContext";
|
||||
import { useState } from "react";
|
||||
|
||||
//import {fetchMessage} from .
|
||||
|
||||
import "./chatWidget.css"
|
||||
|
||||
export default function ChatWidget({convlist}) {
|
||||
|
||||
|
||||
|
||||
return (
|
||||
<div className="convlist">
|
||||
{convlist.map(conv => (
|
||||
<ConvCard
|
||||
key={conv.id}
|
||||
id={conv.id}
|
||||
title={conv.title}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function ConvCard({id, title}) {
|
||||
|
||||
const {fetchMessages} = useHotel();
|
||||
|
||||
return(
|
||||
<div className="convcard">
|
||||
<h3>ConvId : {id} </h3>
|
||||
<h3>Name : {title}</h3>
|
||||
<p onClick={() => fetchMessages({conv_id: 4})}> GET MESSAAGE</p>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
function MessagesBox({id}) {
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user