diff --git a/app/components/Header.tsx b/app/components/Header.tsx
index 4a3e092..c513ff2 100644
--- a/app/components/Header.tsx
+++ b/app/components/Header.tsx
@@ -56,7 +56,7 @@ const Header = ({ user, route }: Props) => {
-
+
{
-
+
{
+ const user = await getUser(request);
+ if (!user) {
+ return redirect("/login");
+ }
+ const data: LoaderData = { user };
+ return data;
+};
+
+export default function JokesIndexRoute() {
+ const data = useLoaderData();
+
+ return (
+ <>
+
+
+
+ Team: {data.user.team.id}
+
+ {!data.user.team.members || data.user.team.members?.length === 0 ? (
+ No members
+ ) : (
+ data.user.team.members.map((member) => (
+
+
+
+
+ {member.icon ?? member.username[0]}
+
+
+
+
{member.username}
+
+
+
+ ))
+ )}
+
+ >
+ );
+}
+
+export function CatchBoundary() {
+ const caught = useCatch();
+
+ if (caught.status === 404) {
+ return (
+ There are no users to display.
+ );
+ }
+ throw new Error(`Unexpected caught response with status: ${caught.status}`);
+}
+
+export function ErrorBoundary() {
+ return I did a whoopsies.
;
+}