30 lines
805 B
TypeScript
30 lines
805 B
TypeScript
import type {} from '@star-kitten/discord/jsx';
|
|
import { ActionRow, Container, Button, TextDisplay } from '@star-kitten/discord';
|
|
|
|
export function renderAppraisal() {
|
|
const formatter = new Intl.NumberFormat('en-US', {
|
|
maximumFractionDigits: 2,
|
|
minimumFractionDigits: 2,
|
|
});
|
|
const world = 'world';
|
|
const rand = Math.random() * 1000;
|
|
const pageCtx = { state: { currentPage: 'home' } };
|
|
|
|
let jsx = (
|
|
<ActionRow>
|
|
<Container color="0x1da57a">
|
|
<TextDisplay content={`Hello ${world}`} />
|
|
{pageCtx.state.currentPage !== 'share' ?
|
|
<ActionRow>
|
|
<Button customId="share" label="Share in Channel" disabled={rand < 500} />
|
|
</ActionRow>
|
|
: undefined}
|
|
</Container>
|
|
</ActionRow>
|
|
);
|
|
|
|
console.log(jsx);
|
|
}
|
|
|
|
renderAppraisal();
|