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
No known key found for this signature in database
GPG key ID: 1AB888B16355FBB2
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 { 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({
reply,
replyNode,
@ -13,16 +24,7 @@ export function DiscordMessage({
followUp,
time,
children,
}: PropsWithChildren<{
author?: IDiscordMessageAuthor | undefined;
authorNode?: ReactNode | undefined;
followUp?: boolean;
interaction?: IDiscordMessageInteraction | undefined;
interactionNode?: ReactNode | undefined;
reply?: IDiscordMessageReply | undefined;
replyNode?: ReactNode | undefined;
time?: string | undefined;
}>) {
}: PropsWithChildren<IDiscordMessage>) {
return (
<div className="relative" id="outer-message-wrapper">
<div

View file

@ -1,6 +1,10 @@
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 (
<div
className={`font-source-sans-pro pt-0.1 bg-[rgb(54_57_63)] pb-4 ${rounded ? 'rounded' : ''}`}