Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion apps/web/app/s/[videoId]/Share.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ type VideoWithOrganizationInfo = typeof videos.$inferSelect & {
organizationId?: string;
sharedOrganizations?: { id: string; name: string }[];
hasPassword?: boolean;
ownerIsPro?: boolean;
orgSettings?: OrganizationSettings | null;
};

Expand All @@ -51,6 +50,7 @@ interface ShareProps {
customDomain: string | null;
domainVerified: boolean;
videoSettings?: OrganizationSettings | null;
ownerIsPro?: boolean;
userOrganizations?: { id: string; name: string }[];
initialAiData?: {
title?: string | null;
Expand Down Expand Up @@ -141,6 +141,7 @@ export const Share = ({
data,
user,
comments,
ownerIsPro,
views,
initialAiData,
aiGenerationEnabled,
Expand Down Expand Up @@ -321,6 +322,7 @@ export const Share = ({
createdAt: effectiveDate,
transcriptionStatus,
}}
ownerIsPro={ownerIsPro}
videoSettings={videoSettings}
user={user}
commentsData={commentsData}
Expand Down
2 changes: 1 addition & 1 deletion apps/web/app/s/[videoId]/_components/ShareHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ export const ShareHeader = ({

return (
<>
{user !== null && !isVideoOwnerPro && (
{isOwner && !isVideoOwnerPro && (
<div className="flex sticky flex-col sm:flex-row inset-x-0 top-0 z-10 gap-4 justify-center items-center px-3 py-2 mx-auto w-[calc(100%-20px)] max-w-fit rounded-b-xl border bg-gray-4 border-gray-6">
<p className="text-center text-gray-12">
Shareable links are limited to 5 mins on the free plan.
Expand Down
7 changes: 3 additions & 4 deletions apps/web/app/s/[videoId]/_components/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ interface SidebarProps {
processing?: boolean;
} | null;
aiGenerationEnabled?: boolean;
ownerIsPro?: boolean;
}

const TabContent = motion.div;
Expand Down Expand Up @@ -85,6 +86,7 @@ export const Sidebar = forwardRef<{ scrollToBottom: () => void }, SidebarProps>(
videoId,
aiData,
aiGenerationEnabled = false,
ownerIsPro,
},
ref,
) => {
Expand Down Expand Up @@ -141,9 +143,6 @@ export const Sidebar = forwardRef<{ scrollToBottom: () => void }, SidebarProps>(
setActiveTab(tabId);
};

const isOwner = user?.id === data.ownerId;
const isVideoOwnerPro = user && isOwner ? userIsPro(user) : false;

const renderTabContent = () => {
switch (activeTab) {
case "activity":
Expand Down Expand Up @@ -184,7 +183,7 @@ export const Sidebar = forwardRef<{ scrollToBottom: () => void }, SidebarProps>(
isSummaryDisabled={videoSettings?.disableSummary}
initialAiData={aiData || undefined}
aiGenerationEnabled={aiGenerationEnabled}
isVideoOwnerPro={isVideoOwnerPro}
ownerIsPro={ownerIsPro}
/>
);
case "transcript":
Expand Down
6 changes: 3 additions & 3 deletions apps/web/app/s/[videoId]/_components/tabs/Summary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ interface SummaryProps {
};
aiGenerationEnabled?: boolean;
isSummaryDisabled?: boolean;
isVideoOwnerPro: boolean | null;
ownerIsPro?: boolean;
}

const formatTime = (time: number) => {
Expand Down Expand Up @@ -66,7 +66,7 @@ export const Summary: React.FC<SummaryProps> = ({
initialAiData,
isSummaryDisabled = false,
aiGenerationEnabled = false,
isVideoOwnerPro,
ownerIsPro,
}) => {
const [aiData, setAiData] = useState<{
title?: string | null;
Expand Down Expand Up @@ -94,7 +94,7 @@ export const Summary: React.FC<SummaryProps> = ({
}
};

if (!isVideoOwnerPro) {
if (!ownerIsPro) {
return (
<div className="flex flex-col justify-center items-center p-8 h-full text-center">
<div className="space-y-4 max-w-sm">
Expand Down
2 changes: 2 additions & 0 deletions apps/web/app/s/[videoId]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -697,6 +697,7 @@ async function AuthorizedContent({
organizationMembers: membersList.map((member) => member.userId),
organizationId: video.sharedOrganization?.organizationId ?? undefined,
sharedOrganizations: sharedOrganizations,
ownerIsPro: video.ownerIsPro ?? false,
password: null,
folderId: null,
orgSettings: video.orgSettings || null,
Expand Down Expand Up @@ -728,6 +729,7 @@ async function AuthorizedContent({
data={videoWithOrganizationInfo}
videoSettings={videoWithOrganizationInfo.settings}
user={user}
ownerIsPro={videoWithOrganizationInfo.ownerIsPro}
comments={commentsPromise}
views={viewsPromise}
customDomain={customDomain}
Expand Down