Skip to content

Commit

Permalink
chore: linting
Browse files Browse the repository at this point in the history
  • Loading branch information
tomwisecodes committed Sep 25, 2024
1 parent 7ff0480 commit 4eb5528
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions apps/nextjs/src/app/aila/[id]/download/DownloadView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ export function DownloadView({ chat }: Readonly<DownloadViewProps>) {
data={exportAllAssets.data}
data-testid="chat-download-lesson-plan"
lesson={lessonPlan}
chatId={id}
/>
<DownloadButton
chatId={id}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ type DownloadAllButtonProps = {
| undefined;

"data-testid"?: string;
chatId: string;
};

type zipDownloadStatus = "idle" | "loading" | "complete" | "error";
Expand All @@ -61,7 +62,7 @@ export const DownloadAllButton = ({
downloadAvailable,
downloadLoading,
data,

chatId,
"data-testid": dataTestId,
}: Readonly<DownloadAllButtonProps>) => {
const link = data && "link" in data ? data.link : "";
Expand Down Expand Up @@ -133,7 +134,7 @@ export const DownloadAllButton = ({
>
<Link
onClick={() => {
trackDownload(ext, analyticsResourceType, lesson, track);
trackDownload(ext, analyticsResourceType, lesson, track, chatId);
handleZipDownloadStatus();
}}
className="flex w-full items-center justify-start gap-15 hover:underline"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import SlidesIcon from "../../SVGParts/SlidesIcon";
import { SendEmailIcon } from "./DownloadAllButton";

export const DownloadButton = ({
chatId,
onClick,
lesson,
title,
Expand All @@ -28,6 +29,7 @@ export const DownloadButton = ({
exportsType,
"data-testid": dataTestId,
}: {
chatId: string;
onClick: () => void;
lesson: LooseLessonPlan;
title: string;
Expand Down Expand Up @@ -60,7 +62,7 @@ export const DownloadButton = ({
>
<Link
onClick={() =>
trackDownload(ext, analyticsResourceType, lesson, track)
trackDownload(ext, analyticsResourceType, lesson, track, chatId)
}
className="flex w-full items-center justify-start gap-15 hover:underline"
href={`/api/aila-download?fileId=${fileId}&ext=${ext}&lessonTitle=${lessonTitle}`}
Expand All @@ -77,7 +79,7 @@ export const DownloadButton = ({
<span className="my-12 h-[2px] w-full bg-black opacity-15" />
<Link
onClick={() =>
trackDownload("pdf", analyticsResourceType, lesson, track)
trackDownload("pdf", analyticsResourceType, lesson, track, chatId)
}
className="flex w-full items-center justify-start gap-15 hover:underline"
href={`/api/aila-download?fileId=${fileId}&ext=pdf&lessonTitle=${lessonTitle}`}
Expand All @@ -98,6 +100,7 @@ export const DownloadButton = ({
analyticsResourceType,
lesson,
track,
chatId,
)
}
className="hidden w-full items-center justify-start gap-15 hover:underline sm:flex"
Expand Down
2 changes: 2 additions & 0 deletions apps/nextjs/src/utils/trackDownload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ export function trackDownload(
analyticsResourceType: ResourceTypeValueType | ResourceTypeValueType[],
lesson: LooseLessonPlan,
track: ReturnType<typeof useAnalytics>["track"],
chatId: string,
) {
track.lessonPlanResourcesDownloaded({
chatId,
...getLessonTrackingProps({ lesson }),
resourceType: Array.isArray(analyticsResourceType)
? analyticsResourceType
Expand Down

0 comments on commit 4eb5528

Please sign in to comment.