diff --git a/app/_components/page-breadcrumb.tsx b/app/_components/page-breadcrumb.tsx
new file mode 100644
index 00000000..a9b3e764
--- /dev/null
+++ b/app/_components/page-breadcrumb.tsx
@@ -0,0 +1,66 @@
+import * as Breadcrumb from '@/_components/breadcrumb';
+import getTeam from '@/_queries/get-team';
+import { User } from '@supabase/supabase-js';
+import { ReactNode } from 'react';
+
+interface BreadcrumbsProps {
+ last?: ReactNode;
+ skeleton?: boolean;
+ user?: User | null;
+}
+
+const PageBreadcrumb = async ({ last, skeleton, user }: BreadcrumbsProps) => {
+ const { data: team } =
+ user?.app_metadata && !user.app_metadata.is_client
+ ? await getTeam(user.app_metadata.active_team_id)
+ : { data: null };
+
+ return (
+
+
+
+
+
+
+
+
+ {team && (
+ <>
+
+ {team.name}
+
+
+ >
+ )}
+ {last && {last}}
+ {skeleton && (
+
+ )}
+
+
+ );
+};
+
+export default PageBreadcrumb;
diff --git a/app/_components/subject-loading.tsx b/app/_components/subject-loading.tsx
index 99973607..2aa81191 100644
--- a/app/_components/subject-loading.tsx
+++ b/app/_components/subject-loading.tsx
@@ -1,8 +1,10 @@
+import PageBreadcrumb from '@/_components/page-breadcrumb';
import Spinner from '@/_components/spinner';
const SubjectLoading = () => (
<>
-
+
+
diff --git a/app/_components/subject-page.tsx b/app/_components/subject-page.tsx
index e38de1bb..2d3020ac 100644
--- a/app/_components/subject-page.tsx
+++ b/app/_components/subject-page.tsx
@@ -3,6 +3,7 @@ import Button from '@/_components/button';
import DirtyHtml from '@/_components/dirty-html';
import Empty from '@/_components/empty';
import EventTypes from '@/_components/event-types';
+import PageBreadcrumb from '@/_components/page-breadcrumb';
import Protocols from '@/_components/protocols';
import SubjectMenu from '@/_components/subject-menu';
import TimelineEvents from '@/_components/timeline-events';
@@ -70,111 +71,118 @@ const SubjectPage = async ({
const subjectData = subject.data as SubjectDataJson;
return (
-
-
- {subjectData?.banner && (
-
{subjectData?.banner}
- )}
- {!!subjectData?.links?.length && (
-
- )}
- {isTeamMember && (
-
-
-
-
-
- )}
- {!subject.archived && (!!protocols?.length || !!eventTypes?.length) && (
-
- {!!protocols?.length && (
-
- )}
- {!!eventTypes?.length && (
-
- )}
+ <>
+
+
+
- )}
- {!!events?.length ? (
-
- ) : (
-
-
- {!isPublic && !subject.archived && !user?.app_metadata.is_client ? (
- !protocols?.length && !eventTypes?.length ? (
-
- You need an
event type or{' '}
-
protocol
-
- to record data. Wink
-
-
+ {subjectData?.banner && (
+
+ {subjectData?.banner}
+
+ )}
+ {!!subjectData?.links?.length && (
+
+ )}
+ {isTeamMember && (
+
+
+
+
+
+ )}
+ {!subject.archived && (!!protocols?.length || !!eventTypes?.length) && (
+
+ {!!protocols?.length && (
+
+ )}
+ {!!eventTypes?.length && (
+
+ )}
+
+ )}
+ {!!events?.length ? (
+
+ ) : (
+
+
+ {!isPublic && !subject.archived && !user?.app_metadata.is_client ? (
+ !protocols?.length && !eventTypes?.length ? (
+
+ You need an
event type or{' '}
+
protocol
+
+ to record data. Wink
+
+ wink.
- wink.
-
+ ) : (
+
+ Without data, you’re just another
+
+ person with an opinion.
+
+ )
) : (
-
- Without data, you’re just another
-
- person with an opinion.
-
- )
- ) : (
- 'No events.'
- )}
-
- )}
-
+ 'No events.'
+ )}
+
+ )}
+
+ >
);
};