fix(ui): expose options for discord components

This commit is contained in:
iCrawl
2023-05-12 20:00:02 +02:00
parent 7c8849fae5
commit 13073acefc
2 changed files with 17 additions and 11 deletions

View File

@@ -3,6 +3,17 @@ import { DiscordMessageAuthor, type IDiscordMessageAuthor } from './MessageAutho
import { DiscordMessageInteraction, type IDiscordMessageInteraction } from './MessageInteraction.js'; import { DiscordMessageInteraction, type IDiscordMessageInteraction } from './MessageInteraction.js';
import { DiscordMessageReply, type IDiscordMessageReply } from './MessageReply.js'; import { DiscordMessageReply, type IDiscordMessageReply } from './MessageReply.js';
export interface IDiscordMessage {
author?: IDiscordMessageAuthor | undefined;
authorNode?: ReactNode | undefined;
followUp?: boolean;
interaction?: IDiscordMessageInteraction | undefined;
interactionNode?: ReactNode | undefined;
reply?: IDiscordMessageReply | undefined;
replyNode?: ReactNode | undefined;
time?: string | undefined;
}
export function DiscordMessage({ export function DiscordMessage({
reply, reply,
replyNode, replyNode,
@@ -13,16 +24,7 @@ export function DiscordMessage({
followUp, followUp,
time, time,
children, children,
}: PropsWithChildren<{ }: PropsWithChildren<IDiscordMessage>) {
author?: IDiscordMessageAuthor | undefined;
authorNode?: ReactNode | undefined;
followUp?: boolean;
interaction?: IDiscordMessageInteraction | undefined;
interactionNode?: ReactNode | undefined;
reply?: IDiscordMessageReply | undefined;
replyNode?: ReactNode | undefined;
time?: string | undefined;
}>) {
return ( return (
<div className="relative" id="outer-message-wrapper"> <div className="relative" id="outer-message-wrapper">
<div <div

View File

@@ -1,6 +1,10 @@
import type { PropsWithChildren } from 'react'; import type { PropsWithChildren } from 'react';
export function DiscordMessages({ rounded, children }: PropsWithChildren<{ rounded?: boolean }>) { export interface IDiscordMessages {
rounded?: boolean;
}
export function DiscordMessages({ rounded, children }: PropsWithChildren<IDiscordMessages>) {
return ( return (
<div <div
className={`font-source-sans-pro pt-0.1 bg-[rgb(54_57_63)] pb-4 ${rounded ? 'rounded' : ''}`} className={`font-source-sans-pro pt-0.1 bg-[rgb(54_57_63)] pb-4 ${rounded ? 'rounded' : ''}`}