The weeb for the next gen discord boat - Wamellow
wamellow.com
bot
discord
1import SadWumpusPic from "@/public/sad-wumpus.gif";
2import { cn } from "@/utils/cn";
3import Image from "next/image";
4import Link from "next/link";
5import { BsDiscord } from "react-icons/bs";
6import { HiHome } from "react-icons/hi";
7
8import { Button } from "./ui/button";
9
10interface Props {
11 title?: string;
12 description?: string;
13 top?: string;
14
15 icon?: React.ReactNode;
16 button?: string;
17 href?: string;
18
19 buttons?: React.ReactNode;
20 children?: React.ReactNode;
21}
22
23export function ScreenMessage({
24 title,
25 description,
26 top = "30vh",
27
28 icon,
29 button,
30 href,
31
32 buttons = (<>
33 <HomeButton />
34 <SupportButton />
35 </>),
36 children = <Image src={SadWumpusPic} alt="" height={141 * 1.5} width={124 * 1.5} />
37}: Props) {
38
39 return (
40 <div
41 className="w-full h-full flex justify-center gap-8"
42 style={{ marginTop: top }}
43 >
44
45 {children && (
46 <div className={cn("relative bottom-8", buttons ? "ml-8" : "ml-4")}>
47 {children}
48 </div>
49 )}
50
51 <div>
52 <div className="mb-8">
53 <h2 className="text-4xl dark:text-neutral-100 text-neutral-900 font-semibold">{title || "Something strange happened..."}</h2>
54 <h3 className="text-lg dark:text-neutral-400 text-neutral-600 font-semibold max-w-xl mt-1">{description || "Some error has occurred, but no worries, we're fixing it!"}</h3>
55 </div>
56
57 {button && href &&
58 <div className="w-full flex flex-col items-center">
59 <Button
60 asChild
61 variant="secondary"
62 >
63 <Link href={href}>
64 {icon}
65 {button}
66 </Link>
67 </Button>
68 </div>
69 }
70
71 {buttons && (
72 <div className="flex flex-wrap gap-2">
73 {buttons}
74 </div>
75 )}
76 </div>
77 </div>
78 );
79}
80
81export function HomeButton() {
82 return (
83 <Button
84 asChild
85 variant="secondary"
86 >
87 <Link href="/">
88 <HiHome />
89 Go back to Home
90 </Link>
91 </Button>
92 );
93}
94
95export function AddButton() {
96 return (
97 <Button asChild>
98 <Link
99 href="/login?invite=true"
100 prefetch={false}
101 >
102 <BsDiscord />
103 Add Wamellow to your server
104 </Link>
105 </Button>
106 );
107}
108
109export function SupportButton() {
110 return (
111 <Button asChild>
112 <Link
113 href="/support"
114 prefetch={false}
115 >
116 <BsDiscord />
117 Join support server
118 </Link>
119 </Button>
120 );
121}