Skip to content

Commit 06009b4

Browse files
authored
prettier (#144)
* pi * prettier --write .
1 parent 8822f97 commit 06009b4

26 files changed

+257
-262
lines changed

web/.prettierignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Ignore node_modules (already ignored by default)
2+
node_modules
3+
4+
# Ignore build output
5+
.next

web/app/(api)/summarize/fetchTranscript.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { Innertube } from 'youtubei.js/web';
22

33
export const fetchTranscript = async (video_id: string) => {
4-
54
const youtube = await Innertube.create({
65
lang: 'en',
76
location: 'US',
+21-20
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,29 @@
11
import OpenAI from 'openai';
22

3-
export async function summarizeTranscript(transcript: string): Promise<string | null> {
4-
const OPEN_AI = new OpenAI({
5-
apiKey: process.env.OPENAI_KEY,
6-
});
7-
8-
const prompt = `
3+
export async function summarizeTranscript(
4+
transcript: string
5+
): Promise<string | null> {
6+
const OPEN_AI = new OpenAI({
7+
apiKey: process.env.OPENAI_KEY,
8+
});
9+
10+
const prompt = `
911
Summarize the following YouTube transcript, start with in this Youtube video, and end with in conclusion {conclusion}
1012
1113
${transcript}
1214
1315
Summary:
1416
`;
15-
16-
const response = await OPEN_AI.chat.completions.create({
17-
model: 'gpt-3.5-turbo',
18-
messages: [
19-
{
20-
role: 'system',
21-
content: prompt,
22-
},
23-
],
24-
});
25-
26-
return response.choices[0].message.content;
27-
}
28-
17+
18+
const response = await OPEN_AI.chat.completions.create({
19+
model: 'gpt-3.5-turbo',
20+
messages: [
21+
{
22+
role: 'system',
23+
content: prompt,
24+
},
25+
],
26+
});
27+
28+
return response.choices[0].message.content;
29+
}

web/app/(landing)/LandingBody.tsx

+2-8
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import { useSearchParams } from 'next/navigation';
66
import { useEffect, useState } from 'react';
77

88
import { type Example } from '@/app/(landing)/page';
9-
import { Marquee } from '@/components/layout/Marquee';
109
import { MarqueeCard } from '@/components/MarqueeCard';
1110
import { SummaryCard } from '@/components/SummaryCard';
11+
import { Marquee } from '@/components/layout/Marquee';
1212
import { Button, Input, Switch } from '@/components/ui';
1313
import {
1414
extractVideoId,
@@ -186,13 +186,7 @@ export default function LandingBody({ examples }: { examples: Example[] }) {
186186
</div>
187187
)}
188188
{loading && <Loader2 className='mx-auto mt-8 h-12 w-12 animate-spin' />}
189-
{(
190-
<SummaryCard
191-
summary={summary}
192-
loading={loading}
193-
video_id={video_id}
194-
/>
195-
)}
189+
{<SummaryCard summary={summary} loading={loading} video_id={video_id} />}
196190
</main>
197191
);
198192
}

web/app/(marketing)/blog/[slug]/page.tsx

+5-3
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import { notFound } from 'next/navigation';
33

44
import { PostBody } from '@/components/mdx/post-body';
55
import { Button } from '@/components/ui/button';
6-
import { getPost } from '@/lib/get-posts';
76
import { AppConfig } from '@/lib/constants';
7+
import { getPost } from '@/lib/get-posts';
88

99
type BlogPostPageParams = Promise<{
1010
slug: string;
@@ -18,7 +18,7 @@ export default async function BlogPostPage(props: {
1818
if (!post) return notFound();
1919

2020
return (
21-
<section className='container mx-auto px-4 py-16 flex flex-col'>
21+
<section className='container mx-auto flex flex-col px-4 py-16'>
2222
{post.image && (
2323
<div className='relative mb-8 h-64 w-full overflow-hidden rounded-md'>
2424
<img
@@ -34,7 +34,9 @@ export default async function BlogPostPage(props: {
3434
<p>{post.date}</p>
3535
<PostBody>{post.body}</PostBody>
3636

37-
<Link href={AppConfig.SITE_MAP.BLOG} className='hover:underline pt-12'>Back to blog</Link>
37+
<Link href={AppConfig.SITE_MAP.BLOG} className='pt-12 hover:underline'>
38+
Back to blog
39+
</Link>
3840
</section>
3941
);
4042
}

web/app/(marketing)/policies/terms/page.tsx

+1-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
import {
2-
Card,
3-
CardContent,
4-
CardHeader,
5-
Separator,
6-
} from '@/components/ui';
1+
import { Card, CardContent, CardHeader, Separator } from '@/components/ui';
72
import { AppConfig } from '@/lib/constants';
83
import { formatISOToHumanReadable } from '@/lib/helpers';
94

web/app/(marketing)/pricing/PricingBody.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ export const PricingBody = () => {
1515
)}
1616
{status === 'cancel' && (
1717
<div className='mb-4 rounded-lg border border-red-200 bg-red-100 p-4 text-center text-red-800'>
18-
Payment was canceled. Please try again if you&apos;d like to subscribe.
18+
Payment was canceled. Please try again if you&apos;d like to
19+
subscribe.
1920
</div>
2021
)}
2122
</div>

web/app/globals.css

+3-1
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,8 @@ body {
129129
transform: translateX(0%);
130130
}
131131
100% {
132-
transform: translateX(-50%); /* Move by 50% of the width to account for duplicated content */
132+
transform: translateX(
133+
-50%
134+
); /* Move by 50% of the width to account for duplicated content */
133135
}
134136
}

web/app/login/page.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export default function Login() {
2222
};
2323

2424
return (
25-
<section className='mx-auto mt-32 flex flex-col justify-between items-center'>
25+
<section className='mx-auto mt-32 flex flex-col items-center justify-between'>
2626
<div className='w-full max-w-md border-2 border-black p-8'>
2727
<Link
2828
href='/'

web/components.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@
1414
"components": "@/components",
1515
"utils": "@/lib/utils"
1616
}
17-
}
17+
}

web/components/SummaryCard.tsx

+1-3
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,7 @@ export const SummaryCard = ({ summary, loading, video_id }) => {
3636
>
3737
<FiExternalLink size={18} />
3838
</a>
39-
<LikeButton
40-
summaryId={summary.id}
41-
/>
39+
<LikeButton summaryId={summary.id} />
4240
</div>
4341
<p>{summary?.summary}</p>
4442
</div>

web/components/icons/GoogleIcon.tsx

+29-30
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,30 @@
11
export function GoogleIcon(props: any) {
2-
return (
3-
<svg
4-
{...props}
5-
xmlns='http://www.w3.org/2000/svg'
6-
x='0px'
7-
y='0px'
8-
width='16'
9-
height='16'
10-
viewBox='0 0 48 48'
11-
>
12-
<path
13-
fill='#FFC107'
14-
d='M43.611,20.083H42V20H24v8h11.303c-1.649,4.657-6.08,8-11.303,8c-6.627,0-12-5.373-12-12c0-6.627,5.373-12,12-12c3.059,0,5.842,1.154,7.961,3.039l5.657-5.657C34.046,6.053,29.268,4,24,4C12.955,4,4,12.955,4,24c0,11.045,8.955,20,20,20c11.045,0,20-8.955,20-20C44,22.659,43.862,21.35,43.611,20.083z'
15-
></path>
16-
<path
17-
fill='#FF3D00'
18-
d='M6.306,14.691l6.571,4.819C14.655,15.108,18.961,12,24,12c3.059,0,5.842,1.154,7.961,3.039l5.657-5.657C34.046,6.053,29.268,4,24,4C16.318,4,9.656,8.337,6.306,14.691z'
19-
></path>
20-
<path
21-
fill='#4CAF50'
22-
d='M24,44c5.166,0,9.86-1.977,13.409-5.192l-6.19-5.238C29.211,35.091,26.715,36,24,36c-5.202,0-9.619-3.317-11.283-7.946l-6.522,5.025C9.505,39.556,16.227,44,24,44z'
23-
></path>
24-
<path
25-
fill='#1976D2'
26-
d='M43.611,20.083H42V20H24v8h11.303c-0.792,2.237-2.231,4.166-4.087,5.571c0.001-0.001,0.002-0.001,0.003-0.002l6.19,5.238C36.971,39.205,44,34,44,24C44,22.659,43.862,21.35,43.611,20.083z'
27-
></path>
28-
</svg>
29-
);
30-
}
31-
2+
return (
3+
<svg
4+
{...props}
5+
xmlns='http://www.w3.org/2000/svg'
6+
x='0px'
7+
y='0px'
8+
width='16'
9+
height='16'
10+
viewBox='0 0 48 48'
11+
>
12+
<path
13+
fill='#FFC107'
14+
d='M43.611,20.083H42V20H24v8h11.303c-1.649,4.657-6.08,8-11.303,8c-6.627,0-12-5.373-12-12c0-6.627,5.373-12,12-12c3.059,0,5.842,1.154,7.961,3.039l5.657-5.657C34.046,6.053,29.268,4,24,4C12.955,4,4,12.955,4,24c0,11.045,8.955,20,20,20c11.045,0,20-8.955,20-20C44,22.659,43.862,21.35,43.611,20.083z'
15+
></path>
16+
<path
17+
fill='#FF3D00'
18+
d='M6.306,14.691l6.571,4.819C14.655,15.108,18.961,12,24,12c3.059,0,5.842,1.154,7.961,3.039l5.657-5.657C34.046,6.053,29.268,4,24,4C16.318,4,9.656,8.337,6.306,14.691z'
19+
></path>
20+
<path
21+
fill='#4CAF50'
22+
d='M24,44c5.166,0,9.86-1.977,13.409-5.192l-6.19-5.238C29.211,35.091,26.715,36,24,36c-5.202,0-9.619-3.317-11.283-7.946l-6.522,5.025C9.505,39.556,16.227,44,24,44z'
23+
></path>
24+
<path
25+
fill='#1976D2'
26+
d='M43.611,20.083H42V20H24v8h11.303c-0.792,2.237-2.231,4.166-4.087,5.571c0.001-0.001,0.002-0.001,0.003-0.002l6.19,5.238C36.971,39.205,44,34,44,24C44,22.659,43.862,21.35,43.611,20.083z'
27+
></path>
28+
</svg>
29+
);
30+
}

web/components/mdx/post-body.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import remarkGfm from 'remark-gfm';
1010

1111
export function PostBody({ children }: { children: string }) {
1212
return (
13-
<div className="prose prose-lg max-w-none pt-12">
13+
<div className='prose prose-lg max-w-none pt-12'>
1414
<MDXRemote
1515
source={children}
1616
options={{

web/components/ui/accordion.tsx

+19-19
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,58 @@
1-
"use client"
1+
'use client';
22

3-
import * as React from "react"
4-
import * as AccordionPrimitive from "@radix-ui/react-accordion"
5-
import { ChevronDown } from "lucide-react"
3+
import * as AccordionPrimitive from '@radix-ui/react-accordion';
4+
import { ChevronDown } from 'lucide-react';
5+
import * as React from 'react';
66

7-
import { cn } from "@/lib/utils"
7+
import { cn } from '@/lib/utils';
88

9-
const Accordion = AccordionPrimitive.Root
9+
const Accordion = AccordionPrimitive.Root;
1010

1111
const AccordionItem = React.forwardRef<
1212
React.ElementRef<typeof AccordionPrimitive.Item>,
1313
React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item>
1414
>(({ className, ...props }, ref) => (
1515
<AccordionPrimitive.Item
1616
ref={ref}
17-
className={cn("border-b", className)}
17+
className={cn('border-b', className)}
1818
{...props}
1919
/>
20-
))
21-
AccordionItem.displayName = "AccordionItem"
20+
));
21+
AccordionItem.displayName = 'AccordionItem';
2222

2323
const AccordionTrigger = React.forwardRef<
2424
React.ElementRef<typeof AccordionPrimitive.Trigger>,
2525
React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Trigger>
2626
>(({ className, children, ...props }, ref) => (
27-
<AccordionPrimitive.Header className="flex">
27+
<AccordionPrimitive.Header className='flex'>
2828
<AccordionPrimitive.Trigger
2929
ref={ref}
3030
className={cn(
31-
"flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",
31+
'flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180',
3232
className
3333
)}
3434
{...props}
3535
>
3636
{children}
37-
<ChevronDown className="h-4 w-4 shrink-0 transition-transform duration-200" />
37+
<ChevronDown className='h-4 w-4 shrink-0 transition-transform duration-200' />
3838
</AccordionPrimitive.Trigger>
3939
</AccordionPrimitive.Header>
40-
))
41-
AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName
40+
));
41+
AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName;
4242

4343
const AccordionContent = React.forwardRef<
4444
React.ElementRef<typeof AccordionPrimitive.Content>,
4545
React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Content>
4646
>(({ className, children, ...props }, ref) => (
4747
<AccordionPrimitive.Content
4848
ref={ref}
49-
className="overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down"
49+
className='overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down'
5050
{...props}
5151
>
52-
<div className={cn("pb-4 pt-0", className)}>{children}</div>
52+
<div className={cn('pb-4 pt-0', className)}>{children}</div>
5353
</AccordionPrimitive.Content>
54-
))
54+
));
5555

56-
AccordionContent.displayName = AccordionPrimitive.Content.displayName
56+
AccordionContent.displayName = AccordionPrimitive.Content.displayName;
5757

58-
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent }
58+
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent };

0 commit comments

Comments
 (0)