blob: 2a74d62c34f4a84af727a7afd64d7cedc60224a9 [file] [log] [blame]
TheCodedProfda197f22023-03-01 18:15:51 -05001import Styles from "../../styles/Components/transcripts.module.css"
2import Author from "./Author";
3import Image from "next/image";
4import Attachment from "./Attachment";
5import Embed from "./Embed";
TheCodedProfc86e44b2023-02-28 17:30:57 -05006
TheCodedProfda197f22023-03-01 18:15:51 -05007function message(props) {
TheCodedProfc86e44b2023-02-28 17:30:57 -05008
TheCodedProfda197f22023-03-01 18:15:51 -05009 return (
10 <div className={Styles.container}>
11 <div className={Styles.verticalFlex} style={{width: "60px"}}>
12 <Image className={Styles.avatar} src={props.message.author.iconURL ?? "https://picsum.photos/50"} width={50} height={50} alt=""/> {/* TODO: Add a cync icon here as a default*/}
13 </div>
14 <div className={Styles.verticalFlex} style={{width: "calc(100vw - 60px - 40px)"}}>
15 <Author message={props.message} />
16 <p className={Styles.messageContent}>{props.message.content}</p>
17 {
18 props.message.embeds ? props.message.embeds.map((embed, index) => {
19 return <Embed key={index.toString()} embed={embed} />
20 }) : null
21 }
22 {
23 props.message.attachments ? props.message.attachments.map((attachment, index) => {
24 return <Attachment key={index.toString()} attachment={attachment} alt="" />
25 }) : null
26 }
27 </div>
28 </div>
29 )
TheCodedProfc86e44b2023-02-28 17:30:57 -050030}
31
TheCodedProfda197f22023-03-01 18:15:51 -050032export default message;