Skip to content

Commit

Permalink
Update incorrectly formatted files
Browse files Browse the repository at this point in the history
  • Loading branch information
itsbrunodev committed Jan 5, 2025
1 parent 17ccd92 commit 338e061
Show file tree
Hide file tree
Showing 21 changed files with 45 additions and 45 deletions.
2 changes: 1 addition & 1 deletion app/api/[language]/[category]/[name]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export async function GET(_: unknown, { params }: SnippetParams) {
}),
{
status: 404,
},
}
);
}
}
2 changes: 1 addition & 1 deletion app/api/[language]/[category]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export async function GET(_: unknown, { params }: SnippetParams) {
}),
{
status: 404,
},
}
);
}
}
2 changes: 1 addition & 1 deletion app/api/[language]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export async function GET(_: unknown, { params }: SnippetParams) {
}),
{
status: 404,
},
}
);
}
}
4 changes: 2 additions & 2 deletions app/api/search/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export async function GET(request: NextRequest) {
}),
{
status: 400,
},
}
);
}

Expand All @@ -37,7 +37,7 @@ export async function GET(request: NextRequest) {
}),
{
status: 404,
},
}
);
}
}
2 changes: 1 addition & 1 deletion app/snippets/[language]/[category]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export async function generateMetadata({

const title = `${toTitleCase(category)} - SnipNest`;
const description = `Snippets in the ${toTitleCase(
category,
category
)} category of ${formatLanguage(language)}.`;

return {
Expand Down
2 changes: 1 addition & 1 deletion components/code-tabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export interface CodeTabProps {

export function Code({ children }: CodeTabProps) {
const validTabs = Children.toArray(
children,
children
) as React.ReactElement<CodeTabProps>[];

const [activeTab, setActiveTab] = useState(0);
Expand Down
10 changes: 5 additions & 5 deletions components/extendui/command.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const Command = React.forwardRef<
ref={ref}
className={cn(
"flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",
className,
className
)}
{...props}
/>
Expand Down Expand Up @@ -57,7 +57,7 @@ const CommandInput = React.forwardRef<
ref={ref}
className={cn(
"flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
className,
className
)}
{...props}
/>
Expand Down Expand Up @@ -100,7 +100,7 @@ const CommandGroup = React.forwardRef<
ref={ref}
className={cn(
"overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",
className,
className
)}
{...props}
/>
Expand Down Expand Up @@ -128,7 +128,7 @@ const CommandItem = React.forwardRef<
ref={ref}
className={cn(
"relative flex cursor-default gap-2 select-none items-center rounded-md px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-secondary data-[selected=true]:text-secondary-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
className,
className
)}
{...props}
/>
Expand All @@ -144,7 +144,7 @@ const CommandShortcut = ({
<span
className={cn(
"ml-auto text-xs tracking-widest text-muted-foreground",
className,
className
)}
{...props}
/>
Expand Down
4 changes: 2 additions & 2 deletions components/grouped-snippets/content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function SidebarMargin({
<div
className={cn(
"flex flex-col gap-6 lg:ml-80 ml-0 w-full lg:pl-6 pl-0 py-6",
className,
className
)}
>
{children}
Expand All @@ -50,7 +50,7 @@ export function GroupedSnippetsContent({
const categoryLink = `/snippets/${params.language}/${params.category}`;

const languageName = LANGUAGES.find(
(language) => language.value === params.language,
(language) => language.value === params.language
)?.name!;
const categoryName = toTitleCase(params.category || "");

Expand Down
8 changes: 4 additions & 4 deletions components/grouped-snippets/list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function SelectMenu({
<span
className={cn(
"truncate",
!languageValue && "text-muted-foreground",
!languageValue && "text-muted-foreground"
)}
>
{languageValue ? (
Expand Down Expand Up @@ -114,7 +114,7 @@ function SelectMenu({
"ml-auto",
languageValue === language.value
? "opacity-100"
: "opacity-0",
: "opacity-0"
)}
/>
</CommandItem>
Expand All @@ -137,7 +137,7 @@ export function GroupedSnippetsList({
const params = useParams<Awaited<SnippetParams["params"]>>();

const [currentLanguage, setCurrentLanguage] = useState<string>(
params.language || LANGUAGES[0].value,
params.language || LANGUAGES[0].value
);

useEffect(() => {
Expand Down Expand Up @@ -174,7 +174,7 @@ export function GroupedSnippetsList({
<span
className={cn(
"text-sm font-normal tabular-nums",
params.category !== category ? "text-muted-foreground" : "",
params.category !== category ? "text-muted-foreground" : ""
)}
>
{groupedSnippets[currentLanguage][category].length}
Expand Down
2 changes: 1 addition & 1 deletion components/mdx-provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import type { JSX } from "react";
export function MdxProvider({ children }: { children: React.ReactNode }) {
const components = useMDXComponents({
pre: (
props: JSX.IntrinsicElements["pre"] & { "data-language"?: string },
props: JSX.IntrinsicElements["pre"] & { "data-language"?: string }
) => {
return (
<>
Expand Down
2 changes: 1 addition & 1 deletion components/ui/breadcrumb.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const BreadcrumbList = React.forwardRef<
ref={ref}
className={cn(
"flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5",
className,
className
)}
{...props}
/>
Expand Down
4 changes: 2 additions & 2 deletions components/ui/button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const buttonVariants = cva(
variant: "default",
size: "default",
},
},
}
);

export interface ButtonProps
Expand All @@ -49,7 +49,7 @@ const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
{...props}
/>
);
},
}
);
Button.displayName = "Button";

Expand Down
10 changes: 5 additions & 5 deletions components/ui/dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const DialogOverlay = React.forwardRef<
ref={ref}
className={cn(
"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
className,
className
)}
{...props}
/>
Expand All @@ -39,7 +39,7 @@ const DialogContent = React.forwardRef<
ref={ref}
className={cn(
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-xl overflow-auto translate-x-[-50%] translate-y-[-50%] gap-4 border border-border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
className,
className
)}
{...props}
>
Expand All @@ -60,7 +60,7 @@ const DialogHeader = ({
<div
className={cn(
"flex flex-col space-y-1.5 text-center sm:text-left",
className,
className
)}
{...props}
/>
Expand All @@ -74,7 +74,7 @@ const DialogFooter = ({
<div
className={cn(
"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
className,
className
)}
{...props}
/>
Expand All @@ -89,7 +89,7 @@ const DialogTitle = React.forwardRef<
ref={ref}
className={cn(
"text-lg font-semibold leading-none tracking-tight",
className,
className
)}
{...props}
/>
Expand Down
4 changes: 2 additions & 2 deletions components/ui/drawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const DrawerContent = React.forwardRef<
ref={ref}
className={cn(
"fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border border-border bg-background",
className,
className
)}
{...props}
>
Expand Down Expand Up @@ -85,7 +85,7 @@ const DrawerTitle = React.forwardRef<
ref={ref}
className={cn(
"text-lg font-semibold leading-none tracking-tight",
className,
className
)}
{...props}
/>
Expand Down
2 changes: 1 addition & 1 deletion components/ui/popover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const PopoverContent = React.forwardRef<
sideOffset={sideOffset}
className={cn(
"z-50 w-72 rounded-md border border-border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
className,
className
)}
{...props}
/>
Expand Down
6 changes: 3 additions & 3 deletions lib/snippets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const basePath = join(process.cwd(), "snippets");
export async function getSnippet(
language: string,
category: string,
name: string,
name: string
): Promise<(Omit<Snippet, "path"> & { snippet: string }) | null> {
try {
const path = join(basePath, language, category, `${name}.mdx`);
Expand All @@ -40,7 +40,7 @@ export async function getSnippet(

const snippet = content.replace(
/export\s+const\s+metadata\s*=\s*\{[^}]*\};(\r\n){2}|```\w*\r\n/g,
"",
""
);

return {
Expand Down Expand Up @@ -110,5 +110,5 @@ export const getGroupedSnippets: () => Promise<GroupedSnippets> = cache(
console.error(e);
return {};
}
},
}
);
2 changes: 1 addition & 1 deletion lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export function toTitleCase(str: string) {
.join(" ")
.replace(
/\w\S*/g,
(txt) => txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase(),
(txt) => txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase()
);
}

Expand Down
2 changes: 1 addition & 1 deletion mdx-components.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export function useMDXComponents(components: MDXComponents) {
return {
...components,
pre: (
props: JSX.IntrinsicElements["pre"] & { "data-language"?: string },
props: JSX.IntrinsicElements["pre"] & { "data-language"?: string }
) => {
return (
<>
Expand Down
2 changes: 1 addition & 1 deletion middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default async function middleware(request: NextRequest) {
{ status: 429, message: "Rate limit exceeded." },
{
status: 429,
},
}
);
}

Expand Down
2 changes: 1 addition & 1 deletion react-to-string.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ declare module "react-to-string" {
| React.ReactElement
| React.ReactNode
| string
| Array<string | React.ReactElement>,
| Array<string | React.ReactElement>
) => string;

export default reactToString;
Expand Down
Loading

0 comments on commit 338e061

Please sign in to comment.