(
)}
>
- {code} {" "}
+ {code}
+ {" "}
+
+ {" "}
{
+function CommandDialog({ children, ...props }: CommandDialogProps) {
return (
);
-};
+}
const CommandInput = React.forwardRef<
React.ElementRef,
@@ -126,10 +127,10 @@ const CommandItem = React.forwardRef<
CommandItem.displayName = CommandPrimitive.Item.displayName;
-const CommandShortcut = ({
+function CommandShortcut({
className,
...props
-}: React.HTMLAttributes) => {
+}: React.HTMLAttributes) {
return (
);
-};
+}
CommandShortcut.displayName = "CommandShortcut";
export {
diff --git a/frontend/src/components/ui/config-copy-button.tsx b/frontend/src/components/ui/config-copy-button.tsx
index 45fc2e92d..5491f3a19 100644
--- a/frontend/src/components/ui/config-copy-button.tsx
+++ b/frontend/src/components/ui/config-copy-button.tsx
@@ -1,8 +1,9 @@
"use client";
-import { cn } from "@/lib/utils";
import { CheckIcon, ClipboardIcon } from "lucide-react";
import { useEffect, useState } from "react";
-import { toast } from "sonner";
+
+import { cn } from "@/lib/utils";
+
import { Card } from "./card";
export default function CodeCopyButton({
@@ -26,7 +27,6 @@ export default function CodeCopyButton({
setHasCopied(true);
-
// toast.success(`copied ${type} to clipboard`, {
// icon: ,
// });
@@ -42,11 +42,13 @@ export default function CodeCopyButton({
className={cn(" right-0 cursor-pointer bg-muted px-3 py-4")}
onClick={() => handleCopy("install command", children)}
>
- {hasCopied ? (
-
- ) : (
-
- )}
+ {hasCopied
+ ? (
+
+ )
+ : (
+
+ )}
Copy
diff --git a/frontend/src/components/ui/dialog.tsx b/frontend/src/components/ui/dialog.tsx
index 4ceea51f5..8b00362e2 100644
--- a/frontend/src/components/ui/dialog.tsx
+++ b/frontend/src/components/ui/dialog.tsx
@@ -53,32 +53,36 @@ const DialogContent = React.forwardRef<
));
DialogContent.displayName = DialogPrimitive.Content.displayName;
-const DialogHeader = ({
+function DialogHeader({
className,
...props
-}: React.HTMLAttributes) => (
-
-);
+}: React.HTMLAttributes) {
+ return (
+
+ );
+}
DialogHeader.displayName = "DialogHeader";
-const DialogFooter = ({
+function DialogFooter({
className,
...props
-}: React.HTMLAttributes) => (
-
-);
+}: React.HTMLAttributes) {
+ return (
+
+ );
+}
DialogFooter.displayName = "DialogFooter";
const DialogTitle = React.forwardRef<
diff --git a/frontend/src/components/ui/dropdown-menu.tsx b/frontend/src/components/ui/dropdown-menu.tsx
index 5e5f6215e..a19c8f15a 100644
--- a/frontend/src/components/ui/dropdown-menu.tsx
+++ b/frontend/src/components/ui/dropdown-menu.tsx
@@ -37,8 +37,8 @@ const DropdownMenuSubTrigger = React.forwardRef<
));
-DropdownMenuSubTrigger.displayName =
- DropdownMenuPrimitive.SubTrigger.displayName;
+DropdownMenuSubTrigger.displayName
+ = DropdownMenuPrimitive.SubTrigger.displayName;
const DropdownMenuSubContent = React.forwardRef<
React.ElementRef,
@@ -53,8 +53,8 @@ const DropdownMenuSubContent = React.forwardRef<
{...props}
/>
));
-DropdownMenuSubContent.displayName =
- DropdownMenuPrimitive.SubContent.displayName;
+DropdownMenuSubContent.displayName
+ = DropdownMenuPrimitive.SubContent.displayName;
const DropdownMenuContent = React.forwardRef<
React.ElementRef,
@@ -113,8 +113,8 @@ const DropdownMenuCheckboxItem = React.forwardRef<
{children}
));
-DropdownMenuCheckboxItem.displayName =
- DropdownMenuPrimitive.CheckboxItem.displayName;
+DropdownMenuCheckboxItem.displayName
+ = DropdownMenuPrimitive.CheckboxItem.displayName;
const DropdownMenuRadioItem = React.forwardRef<
React.ElementRef,
@@ -168,17 +168,17 @@ const DropdownMenuSeparator = React.forwardRef<
));
DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
-const DropdownMenuShortcut = ({
+function DropdownMenuShortcut({
className,
...props
-}: React.HTMLAttributes) => {
+}: React.HTMLAttributes) {
return (
);
-};
+}
DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
export {
diff --git a/frontend/src/components/ui/input.tsx b/frontend/src/components/ui/input.tsx
index 9d631e7fa..e323dd312 100644
--- a/frontend/src/components/ui/input.tsx
+++ b/frontend/src/components/ui/input.tsx
@@ -2,8 +2,7 @@ import * as React from "react";
import { cn } from "@/lib/utils";
-export interface InputProps
- extends React.InputHTMLAttributes {}
+export type InputProps = {} & React.InputHTMLAttributes;
const Input = React.forwardRef(
({ className, type, ...props }, ref) => {
diff --git a/frontend/src/components/ui/label.tsx b/frontend/src/components/ui/label.tsx
index 534182176..943225b32 100644
--- a/frontend/src/components/ui/label.tsx
+++ b/frontend/src/components/ui/label.tsx
@@ -1,26 +1,28 @@
-"use client"
+"use client";
-import * as React from "react"
-import * as LabelPrimitive from "@radix-ui/react-label"
-import { cva, type VariantProps } from "class-variance-authority"
+import type { VariantProps } from "class-variance-authority";
-import { cn } from "@/lib/utils"
+import * as LabelPrimitive from "@radix-ui/react-label";
+import { cva } from "class-variance-authority";
+import * as React from "react";
+
+import { cn } from "@/lib/utils";
const labelVariants = cva(
- "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
-)
+ "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
+);
const Label = React.forwardRef<
React.ElementRef,
- React.ComponentPropsWithoutRef &
- VariantProps
+ React.ComponentPropsWithoutRef
+ & VariantProps
>(({ className, ...props }, ref) => (
-))
-Label.displayName = LabelPrimitive.Root.displayName
+));
+Label.displayName = LabelPrimitive.Root.displayName;
-export { Label }
+export { Label };
diff --git a/frontend/src/components/ui/navigation-menu.tsx b/frontend/src/components/ui/navigation-menu.tsx
index 203466d69..4cf774ece 100644
--- a/frontend/src/components/ui/navigation-menu.tsx
+++ b/frontend/src/components/ui/navigation-menu.tsx
@@ -53,7 +53,8 @@ const NavigationMenuTrigger = React.forwardRef<
className={cn(navigationMenuTriggerStyle(), "group", className)}
{...props}
>
- {children}{" "}
+ {children}
+ {" "}
));
-NavigationMenuViewport.displayName =
- NavigationMenuPrimitive.Viewport.displayName;
+NavigationMenuViewport.displayName
+ = NavigationMenuPrimitive.Viewport.displayName;
const NavigationMenuIndicator = React.forwardRef<
React.ElementRef,
@@ -112,8 +113,8 @@ const NavigationMenuIndicator = React.forwardRef<
));
-NavigationMenuIndicator.displayName =
- NavigationMenuPrimitive.Indicator.displayName;
+NavigationMenuIndicator.displayName
+ = NavigationMenuPrimitive.Indicator.displayName;
export {
NavigationMenu,
diff --git a/frontend/src/components/ui/number-ticker.tsx b/frontend/src/components/ui/number-ticker.tsx
index d9c387939..1819b53d1 100644
--- a/frontend/src/components/ui/number-ticker.tsx
+++ b/frontend/src/components/ui/number-ticker.tsx
@@ -30,10 +30,10 @@ export default function NumberTicker({
});
useEffect(() => {
- isInView &&
- setTimeout(() => {
- motionValue.set(direction === "down" ? 0 : value);
- }, delay * 1000);
+ isInView
+ && setTimeout(() => {
+ motionValue.set(direction === "down" ? 0 : value);
+ }, delay * 1000);
}, [motionValue, isInView, delay, value, direction]);
useEffect(
diff --git a/frontend/src/components/ui/particles.tsx b/frontend/src/components/ui/particles.tsx
index 3ce2a2923..30f1813c7 100644
--- a/frontend/src/components/ui/particles.tsx
+++ b/frontend/src/components/ui/particles.tsx
@@ -1,12 +1,13 @@
"use client";
-import { cn } from "@/lib/utils";
import React, { useEffect, useRef, useState } from "react";
-interface MousePosition {
+import { cn } from "@/lib/utils";
+
+type MousePosition = {
x: number;
y: number;
-}
+};
function MousePosition(): MousePosition {
const [mousePosition, setMousePosition] = useState({
@@ -29,7 +30,7 @@ function MousePosition(): MousePosition {
return mousePosition;
}
-interface ParticlesProps {
+type ParticlesProps = {
className?: string;
quantity?: number;
staticity?: number;
@@ -39,18 +40,18 @@ interface ParticlesProps {
color?: string;
vx?: number;
vy?: number;
-}
+};
function hexToRgb(hex: string): number[] {
hex = hex.replace("#", "");
if (hex.length === 3) {
hex = hex
.split("")
- .map((char) => char + char)
+ .map(char => char + char)
.join("");
}
- const hexInt = parseInt(hex, 16);
+ const hexInt = Number.parseInt(hex, 16);
const red = (hexInt >> 16) & 255;
const green = (hexInt >> 8) & 255;
const blue = hexInt & 255;
@@ -150,7 +151,7 @@ const Particles: React.FC = ({
const translateY = 0;
const pSize = Math.floor(Math.random() * 2) + size;
const alpha = 0;
- const targetAlpha = parseFloat((Math.random() * 0.6 + 0.1).toFixed(1));
+ const targetAlpha = Number.parseFloat((Math.random() * 0.6 + 0.1).toFixed(1));
const dx = (Math.random() - 0.5) * 0.1;
const dy = (Math.random() - 0.5) * 0.1;
const magnetism = 0.1 + Math.random() * 4;
@@ -213,8 +214,8 @@ const Particles: React.FC = ({
start2: number,
end2: number,
): number => {
- const remapped =
- ((value - start1) * (end2 - start2)) / (end1 - start1) + start2;
+ const remapped
+ = ((value - start1) * (end2 - start2)) / (end1 - start1) + start2;
return remapped > 0 ? remapped : 0;
};
@@ -229,7 +230,7 @@ const Particles: React.FC = ({
canvasSize.current.h - circle.y - circle.translateY - circle.size, // distance from bottom edge
];
const closestEdge = edge.reduce((a, b) => Math.min(a, b));
- const remapClosestEdge = parseFloat(
+ const remapClosestEdge = Number.parseFloat(
remapValue(closestEdge, 0, 20, 0, 1).toFixed(2),
);
if (remapClosestEdge > 1) {
@@ -237,26 +238,27 @@ const Particles: React.FC = ({
if (circle.alpha > circle.targetAlpha) {
circle.alpha = circle.targetAlpha;
}
- } else {
+ }
+ else {
circle.alpha = circle.targetAlpha * remapClosestEdge;
}
circle.x += circle.dx + vx;
circle.y += circle.dy + vy;
- circle.translateX +=
- (mouse.current.x / (staticity / circle.magnetism) - circle.translateX) /
- ease;
- circle.translateY +=
- (mouse.current.y / (staticity / circle.magnetism) - circle.translateY) /
- ease;
+ circle.translateX
+ += (mouse.current.x / (staticity / circle.magnetism) - circle.translateX)
+ / ease;
+ circle.translateY
+ += (mouse.current.y / (staticity / circle.magnetism) - circle.translateY)
+ / ease;
drawCircle(circle, true);
// circle gets out of the canvas
if (
- circle.x < -circle.size ||
- circle.x > canvasSize.current.w + circle.size ||
- circle.y < -circle.size ||
- circle.y > canvasSize.current.h + circle.size
+ circle.x < -circle.size
+ || circle.x > canvasSize.current.w + circle.size
+ || circle.y < -circle.size
+ || circle.y > canvasSize.current.h + circle.size
) {
// remove the circle from the array
circles.current.splice(i, 1);
diff --git a/frontend/src/components/ui/popover.tsx b/frontend/src/components/ui/popover.tsx
index a0ec48bee..617cc72d9 100644
--- a/frontend/src/components/ui/popover.tsx
+++ b/frontend/src/components/ui/popover.tsx
@@ -1,13 +1,13 @@
-"use client"
+"use client";
-import * as React from "react"
-import * as PopoverPrimitive from "@radix-ui/react-popover"
+import * as PopoverPrimitive from "@radix-ui/react-popover";
+import * as React from "react";
-import { cn } from "@/lib/utils"
+import { cn } from "@/lib/utils";
-const Popover = PopoverPrimitive.Root
+const Popover = PopoverPrimitive.Root;
-const PopoverTrigger = PopoverPrimitive.Trigger
+const PopoverTrigger = PopoverPrimitive.Trigger;
const PopoverContent = React.forwardRef<
React.ElementRef,
@@ -20,12 +20,12 @@ const PopoverContent = React.forwardRef<
sideOffset={sideOffset}
className={cn(
"z-50 w-72 rounded-md 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}
/>
-))
-PopoverContent.displayName = PopoverPrimitive.Content.displayName
+));
+PopoverContent.displayName = PopoverPrimitive.Content.displayName;
-export { Popover, PopoverTrigger, PopoverContent }
+export { Popover, PopoverContent, PopoverTrigger };
diff --git a/frontend/src/components/ui/select.tsx b/frontend/src/components/ui/select.tsx
index cbe5a36b6..c1d12e797 100644
--- a/frontend/src/components/ui/select.tsx
+++ b/frontend/src/components/ui/select.tsx
@@ -1,16 +1,16 @@
-"use client"
+"use client";
-import * as React from "react"
-import * as SelectPrimitive from "@radix-ui/react-select"
-import { Check, ChevronDown, ChevronUp } from "lucide-react"
+import { Check, ChevronDown, ChevronUp } from "lucide-react";
+import * as SelectPrimitive from "@radix-ui/react-select";
+import * as React from "react";
-import { cn } from "@/lib/utils"
+import { cn } from "@/lib/utils";
-const Select = SelectPrimitive.Root
+const Select = SelectPrimitive.Root;
-const SelectGroup = SelectPrimitive.Group
+const SelectGroup = SelectPrimitive.Group;
-const SelectValue = SelectPrimitive.Value
+const SelectValue = SelectPrimitive.Value;
const SelectTrigger = React.forwardRef<
React.ElementRef,
@@ -20,7 +20,7 @@ const SelectTrigger = React.forwardRef<
ref={ref}
className={cn(
"flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
- className
+ className,
)}
{...props}
>
@@ -29,8 +29,8 @@ const SelectTrigger = React.forwardRef<
-))
-SelectTrigger.displayName = SelectPrimitive.Trigger.displayName
+));
+SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
const SelectScrollUpButton = React.forwardRef<
React.ElementRef,
@@ -40,14 +40,14 @@ const SelectScrollUpButton = React.forwardRef<
ref={ref}
className={cn(
"flex cursor-default items-center justify-center py-1",
- className
+ className,
)}
{...props}
>
-))
-SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName
+));
+SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
const SelectScrollDownButton = React.forwardRef<
React.ElementRef,
@@ -57,15 +57,15 @@ const SelectScrollDownButton = React.forwardRef<
ref={ref}
className={cn(
"flex cursor-default items-center justify-center py-1",
- className
+ className,
)}
{...props}
>
-))
-SelectScrollDownButton.displayName =
- SelectPrimitive.ScrollDownButton.displayName
+));
+SelectScrollDownButton.displayName
+ = SelectPrimitive.ScrollDownButton.displayName;
const SelectContent = React.forwardRef<
React.ElementRef,
@@ -76,9 +76,9 @@ const SelectContent = React.forwardRef<
ref={ref}
className={cn(
"relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md 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",
- position === "popper" &&
- "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
- className
+ position === "popper"
+ && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
+ className,
)}
position={position}
{...props}
@@ -87,8 +87,8 @@ const SelectContent = React.forwardRef<
{children}
@@ -96,8 +96,8 @@ const SelectContent = React.forwardRef<
-))
-SelectContent.displayName = SelectPrimitive.Content.displayName
+));
+SelectContent.displayName = SelectPrimitive.Content.displayName;
const SelectLabel = React.forwardRef<
React.ElementRef,
@@ -108,8 +108,8 @@ const SelectLabel = React.forwardRef<
className={cn("py-1.5 pl-8 pr-2 text-sm font-semibold", className)}
{...props}
/>
-))
-SelectLabel.displayName = SelectPrimitive.Label.displayName
+));
+SelectLabel.displayName = SelectPrimitive.Label.displayName;
const SelectItem = React.forwardRef<
React.ElementRef,
@@ -119,7 +119,7 @@ const SelectItem = React.forwardRef<
ref={ref}
className={cn(
"relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
- className
+ className,
)}
{...props}
>
@@ -131,8 +131,8 @@ const SelectItem = React.forwardRef<
{children}
-))
-SelectItem.displayName = SelectPrimitive.Item.displayName
+));
+SelectItem.displayName = SelectPrimitive.Item.displayName;
const SelectSeparator = React.forwardRef<
React.ElementRef,
@@ -143,18 +143,18 @@ const SelectSeparator = React.forwardRef<
className={cn("-mx-1 my-1 h-px bg-muted", className)}
{...props}
/>
-))
-SelectSeparator.displayName = SelectPrimitive.Separator.displayName
+));
+SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
export {
Select,
- SelectGroup,
- SelectValue,
- SelectTrigger,
SelectContent,
- SelectLabel,
+ SelectGroup,
SelectItem,
- SelectSeparator,
- SelectScrollUpButton,
+ SelectLabel,
SelectScrollDownButton,
-}
+ SelectScrollUpButton,
+ SelectSeparator,
+ SelectTrigger,
+ SelectValue,
+};
diff --git a/frontend/src/components/ui/sheet.tsx b/frontend/src/components/ui/sheet.tsx
index 40bb715ee..2f0f784d8 100644
--- a/frontend/src/components/ui/sheet.tsx
+++ b/frontend/src/components/ui/sheet.tsx
@@ -1,7 +1,9 @@
"use client";
+import type { VariantProps } from "class-variance-authority";
+
import * as SheetPrimitive from "@radix-ui/react-dialog";
-import { cva, type VariantProps } from "class-variance-authority";
+import { cva } from "class-variance-authority";
import { X } from "lucide-react";
import * as React from "react";
@@ -49,9 +51,7 @@ const sheetVariants = cva(
},
);
-interface SheetContentProps
- extends React.ComponentPropsWithoutRef,
- VariantProps {}
+type SheetContentProps = {} & React.ComponentPropsWithoutRef & VariantProps;
const SheetContent = React.forwardRef<
React.ElementRef,
@@ -74,32 +74,36 @@ const SheetContent = React.forwardRef<
));
SheetContent.displayName = SheetPrimitive.Content.displayName;
-const SheetHeader = ({
+function SheetHeader({
className,
...props
-}: React.HTMLAttributes) => (
-
-);
+}: React.HTMLAttributes) {
+ return (
+
+ );
+}
SheetHeader.displayName = "SheetHeader";
-const SheetFooter = ({
+function SheetFooter({
className,
...props
-}: React.HTMLAttributes) => (
-
-);
+}: React.HTMLAttributes) {
+ return (
+
+ );
+}
SheetFooter.displayName = "SheetFooter";
const SheetTitle = React.forwardRef<
diff --git a/frontend/src/components/ui/sonner.tsx b/frontend/src/components/ui/sonner.tsx
index 549cf8413..895d1d5e9 100644
--- a/frontend/src/components/ui/sonner.tsx
+++ b/frontend/src/components/ui/sonner.tsx
@@ -1,11 +1,11 @@
"use client";
-import { useTheme } from "next-themes";
import { Toaster as Sonner } from "sonner";
+import { useTheme } from "next-themes";
type ToasterProps = React.ComponentProps;
-const Toaster = ({ ...props }: ToasterProps) => {
+function Toaster({ ...props }: ToasterProps) {
const { theme = "system" } = useTheme();
return (
@@ -26,6 +26,6 @@ const Toaster = ({ ...props }: ToasterProps) => {
{...props}
/>
);
-};
+}
export { Toaster };
diff --git a/frontend/src/components/ui/star-on-github-button.tsx b/frontend/src/components/ui/star-on-github-button.tsx
index fd8b4edcc..6fe1d360f 100644
--- a/frontend/src/components/ui/star-on-github-button.tsx
+++ b/frontend/src/components/ui/star-on-github-button.tsx
@@ -1,10 +1,12 @@
-import { basePath } from "@/config/siteConfig";
-import { cn } from "@/lib/utils";
-import Link from "next/link";
-import { useEffect, useState } from "react";
import { FaGithub, FaStar } from "react-icons/fa";
-import { buttonVariants } from "./button";
+import { useEffect, useState } from "react";
+import Link from "next/link";
+
+import { basePath } from "@/config/site-config";
+import { cn } from "@/lib/utils";
+
import NumberTicker from "./number-ticker";
+import { buttonVariants } from "./button";
export default function StarOnGithubButton() {
const [stars, setStars] = useState(0);
@@ -23,7 +25,8 @@ export default function StarOnGithubButton() {
const data = await res.json();
setStars(data.stargazers_count || stars);
}
- } catch (error) {
+ }
+ catch (error) {
console.error("Error fetching stars:", error);
}
};
@@ -43,7 +46,8 @@ export default function StarOnGithubButton() {
- Star on GitHub{" "}
+ Star on GitHub
+ {" "}
diff --git a/frontend/src/components/ui/switch.tsx b/frontend/src/components/ui/switch.tsx
index bc69cf2db..4b6c039b1 100644
--- a/frontend/src/components/ui/switch.tsx
+++ b/frontend/src/components/ui/switch.tsx
@@ -1,9 +1,9 @@
-"use client"
+"use client";
-import * as React from "react"
-import * as SwitchPrimitives from "@radix-ui/react-switch"
+import * as SwitchPrimitives from "@radix-ui/react-switch";
+import * as React from "react";
-import { cn } from "@/lib/utils"
+import { cn } from "@/lib/utils";
const Switch = React.forwardRef<
React.ElementRef,
@@ -12,18 +12,18 @@ const Switch = React.forwardRef<
-))
-Switch.displayName = SwitchPrimitives.Root.displayName
+));
+Switch.displayName = SwitchPrimitives.Root.displayName;
-export { Switch }
+export { Switch };
diff --git a/frontend/src/components/ui/table.tsx b/frontend/src/components/ui/table.tsx
index c0df655c0..3b6046fd4 100644
--- a/frontend/src/components/ui/table.tsx
+++ b/frontend/src/components/ui/table.tsx
@@ -1,6 +1,6 @@
-import * as React from "react"
+import * as React from "react";
-import { cn } from "@/lib/utils"
+import { cn } from "@/lib/utils";
const Table = React.forwardRef<
HTMLTableElement,
@@ -13,16 +13,16 @@ const Table = React.forwardRef<
{...props}
/>
-))
-Table.displayName = "Table"
+));
+Table.displayName = "Table";
const TableHeader = React.forwardRef<
HTMLTableSectionElement,
React.HTMLAttributes
>(({ className, ...props }, ref) => (
-))
-TableHeader.displayName = "TableHeader"
+));
+TableHeader.displayName = "TableHeader";
const TableBody = React.forwardRef<
HTMLTableSectionElement,
@@ -33,8 +33,8 @@ const TableBody = React.forwardRef<
className={cn("[&_tr:last-child]:border-0", className)}
{...props}
/>
-))
-TableBody.displayName = "TableBody"
+));
+TableBody.displayName = "TableBody";
const TableFooter = React.forwardRef<
HTMLTableSectionElement,
@@ -44,12 +44,12 @@ const TableFooter = React.forwardRef<
ref={ref}
className={cn(
"border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",
- className
+ className,
)}
{...props}
/>
-))
-TableFooter.displayName = "TableFooter"
+));
+TableFooter.displayName = "TableFooter";
const TableRow = React.forwardRef<
HTMLTableRowElement,
@@ -59,12 +59,12 @@ const TableRow = React.forwardRef<
ref={ref}
className={cn(
"border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",
- className
+ className,
)}
{...props}
/>
-))
-TableRow.displayName = "TableRow"
+));
+TableRow.displayName = "TableRow";
const TableHead = React.forwardRef<
HTMLTableCellElement,
@@ -74,12 +74,12 @@ const TableHead = React.forwardRef<
ref={ref}
className={cn(
"h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
- className
+ className,
)}
{...props}
/>
-))
-TableHead.displayName = "TableHead"
+));
+TableHead.displayName = "TableHead";
const TableCell = React.forwardRef<
HTMLTableCellElement,
@@ -89,12 +89,12 @@ const TableCell = React.forwardRef<
ref={ref}
className={cn(
"p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
- className
+ className,
)}
{...props}
/>
-))
-TableCell.displayName = "TableCell"
+));
+TableCell.displayName = "TableCell";
const TableCaption = React.forwardRef<
HTMLTableCaptionElement,
@@ -105,16 +105,16 @@ const TableCaption = React.forwardRef<
className={cn("mt-4 text-sm text-muted-foreground", className)}
{...props}
/>
-))
-TableCaption.displayName = "TableCaption"
+));
+TableCaption.displayName = "TableCaption";
export {
Table,
- TableHeader,
TableBody,
+ TableCaption,
+ TableCell,
TableFooter,
TableHead,
+ TableHeader,
TableRow,
- TableCell,
- TableCaption,
-}
+};
diff --git a/frontend/src/components/ui/textarea.tsx b/frontend/src/components/ui/textarea.tsx
index 4d858bb6b..55ede4a74 100644
--- a/frontend/src/components/ui/textarea.tsx
+++ b/frontend/src/components/ui/textarea.tsx
@@ -1,6 +1,6 @@
-import * as React from "react"
+import * as React from "react";
-import { cn } from "@/lib/utils"
+import { cn } from "@/lib/utils";
const Textarea = React.forwardRef<
HTMLTextAreaElement,
@@ -10,13 +10,13 @@ const Textarea = React.forwardRef<
- )
-})
-Textarea.displayName = "Textarea"
+ );
+});
+Textarea.displayName = "Textarea";
-export { Textarea }
+export { Textarea };
diff --git a/frontend/src/components/ui/theme-toggle.tsx b/frontend/src/components/ui/theme-toggle.tsx
index 6240554de..5851a0722 100644
--- a/frontend/src/components/ui/theme-toggle.tsx
+++ b/frontend/src/components/ui/theme-toggle.tsx
@@ -2,21 +2,24 @@
import { MoonIcon, SunIcon } from "@radix-ui/react-icons";
import { useTheme } from "next-themes";
-import { Button } from "./button";
+
import {
Tooltip,
TooltipContent,
TooltipProvider,
TooltipTrigger,
} from "./tooltip";
+import { Button } from "./button";
export function ThemeToggle() {
const { setTheme, theme: currentTheme } = useTheme();
const handleChangeTheme = (theme: "light" | "dark") => {
- if (theme === currentTheme) return;
+ if (theme === currentTheme)
+ return;
- if (!document.startViewTransition) return setTheme(theme);
+ if (!document.startViewTransition)
+ return setTheme(theme);
document.startViewTransition(() => setTheme(theme));
};
@@ -31,8 +34,7 @@ export function ThemeToggle() {
className="px-2"
aria-label="Toggle theme"
onClick={() =>
- handleChangeTheme(currentTheme === "dark" ? "light" : "dark")
- }
+ handleChangeTheme(currentTheme === "dark" ? "light" : "dark")}
>
diff --git a/frontend/src/components/ui/tooltip.tsx b/frontend/src/components/ui/tooltip.tsx
index e1ae87b9d..143823473 100644
--- a/frontend/src/components/ui/tooltip.tsx
+++ b/frontend/src/components/ui/tooltip.tsx
@@ -1,15 +1,15 @@
-"use client"
+"use client";
-import * as React from "react"
-import * as TooltipPrimitive from "@radix-ui/react-tooltip"
+import * as TooltipPrimitive from "@radix-ui/react-tooltip";
+import * as React from "react";
-import { cn } from "@/lib/utils"
+import { cn } from "@/lib/utils";
-const TooltipProvider = TooltipPrimitive.Provider
+const TooltipProvider = TooltipPrimitive.Provider;
-const Tooltip = TooltipPrimitive.Root
+const Tooltip = TooltipPrimitive.Root;
-const TooltipTrigger = TooltipPrimitive.Trigger
+const TooltipTrigger = TooltipPrimitive.Trigger;
const TooltipContent = React.forwardRef<
React.ElementRef,
@@ -20,11 +20,11 @@ const TooltipContent = React.forwardRef<
sideOffset={sideOffset}
className={cn(
"z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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 origin-[--radix-tooltip-content-transform-origin]",
- className
+ className,
)}
{...props}
/>
-))
-TooltipContent.displayName = TooltipPrimitive.Content.displayName
+));
+TooltipContent.displayName = TooltipPrimitive.Content.displayName;
-export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider }
+export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger };
diff --git a/frontend/src/config/faqConfig.tsx b/frontend/src/config/faq-config.tsx
similarity index 88%
rename from frontend/src/config/faqConfig.tsx
rename to frontend/src/config/faq-config.tsx
index 873435e83..84d1f7072 100644
--- a/frontend/src/config/faqConfig.tsx
+++ b/frontend/src/config/faq-config.tsx
@@ -25,9 +25,9 @@ export const FAQ_Items = [
"Updates via our LXC scripts might not pull the absolute latest version for a few reasons:\n- A bug in the application's release naming on GitHub.\n- A bug in our update script.\n- We intentionally pinned the version. This happens if a newer version has breaking changes or serious bugs that could affect your data or LXC stability. We wait for fixes before allowing the update.",
},
{
- title: 'Why am I getting a "502 Bad Gateway" error?',
+ title: "Why am I getting a \"502 Bad Gateway\" error?",
content:
- 'A "502 Bad Gateway" error usually means the application inside the LXC is not running or responding correctly. Check the application\'s logs first. If you use a reverse proxy, check its logs too. If you still have problems after checking the logs, report the issue, providing details from the logs.',
+ "A \"502 Bad Gateway\" error usually means the application inside the LXC is not running or responding correctly. Check the application's logs first. If you use a reverse proxy, check its logs too. If you still have problems after checking the logs, report the issue, providing details from the logs.",
},
{
title: "What should I do if a script fails during execution?",
diff --git a/frontend/src/config/siteConfig.tsx b/frontend/src/config/site-config.tsx
similarity index 50%
rename from frontend/src/config/siteConfig.tsx
rename to frontend/src/config/site-config.tsx
index 0954e4e11..46d99a698 100644
--- a/frontend/src/config/siteConfig.tsx
+++ b/frontend/src/config/site-config.tsx
@@ -1,45 +1,45 @@
-import { OperatingSystem } from "@/lib/types";
import { MessagesSquare, Scroll } from "lucide-react";
-import React from "react";
import { FaDiscord, FaGithub } from "react-icons/fa";
+import React from "react";
-export const basePath = process.env.BASE_PATH;
+import type { OperatingSystem } from "@/lib/types";
-const isMobile = typeof window !== "undefined" && window.innerWidth < 640;
+// eslint-disable-next-line node/no-process-env
+export const basePath = process.env.BASE_PATH || "";
export const navbarLinks = [
- {
- href: `https://github.com/community-scripts/${basePath}`,
- event: "Github",
- icon: ,
- text: "Github",
- },
- {
- href: `https://discord.gg/2wvnMDgdnU`,
- event: "Discord",
- icon: ,
- text: "Discord",
- },
- {
- href: `https://github.com/community-scripts/${basePath}/blob/main/CHANGELOG.md`,
- event: "Change Log",
- icon: ,
- text: "Change Log",
+ {
+ href: `https://github.com/community-scripts/${basePath}`,
+ event: "Github",
+ icon: ,
+ text: "Github",
+ },
+ {
+ href: `https://discord.gg/2wvnMDgdnU`,
+ event: "Discord",
+ icon: ,
+ text: "Discord",
+ },
+ {
+ href: `https://github.com/community-scripts/${basePath}/blob/main/CHANGELOG.md`,
+ event: "Change Log",
+ icon: ,
+ text: "Change Log",
mobileHidden: true,
- },
- {
- href: `https://github.com/community-scripts/${basePath}/discussions`,
- event: "Discussions",
- icon: ,
- text: "Discussions",
+ },
+ {
+ href: `https://github.com/community-scripts/${basePath}/discussions`,
+ event: "Discussions",
+ icon: ,
+ text: "Discussions",
mobileHidden: true,
- },
+ },
].filter(Boolean) as {
- href: string;
- event: string;
- icon: React.ReactNode;
- text: string;
- mobileHidden?: boolean;
+ href: string;
+ event: string;
+ icon: React.ReactNode;
+ text: string;
+ mobileHidden?: boolean;
}[];
export const mostPopularScripts = ["post-pve-install", "docker", "homeassistant"];
diff --git a/frontend/src/hooks/useVersions.ts b/frontend/src/hooks/use-versions.ts
similarity index 91%
rename from frontend/src/hooks/useVersions.ts
rename to frontend/src/hooks/use-versions.ts
index 44404f4fa..566dc5834 100644
--- a/frontend/src/hooks/useVersions.ts
+++ b/frontend/src/hooks/use-versions.ts
@@ -1,9 +1,11 @@
"use client";
-import { fetchVersions } from "@/lib/data";
-import { AppVersion } from "@/lib/types";
import { useQuery } from "@tanstack/react-query";
+import type { AppVersion } from "@/lib/types";
+
+import { fetchVersions } from "@/lib/data";
+
export function useVersions() {
return useQuery({
queryKey: ["versions"],
diff --git a/frontend/src/lib/data.ts b/frontend/src/lib/data.ts
index 526cc628b..cb0f6acef 100644
--- a/frontend/src/lib/data.ts
+++ b/frontend/src/lib/data.ts
@@ -1,18 +1,18 @@
-import { Category } from "./types";
+import type { Category } from "./types";
-export const fetchCategories = async () => {
+export async function fetchCategories() {
const response = await fetch("api/categories");
if (!response.ok) {
throw new Error(`Failed to fetch categories: ${response.statusText}`);
}
const categories: Category[] = await response.json();
return categories;
-};
+}
-export const fetchVersions = async () => {
+export async function fetchVersions() {
const response = await fetch(`api/versions`);
if (!response.ok) {
- throw new Error(`Failed to fetch versions: ${response.statusText}`);
+ throw new Error(`Failed to fetch versions: ${response.statusText}`);
}
return response.json();
-};
+}
diff --git a/frontend/src/lib/types.ts b/frontend/src/lib/types.ts
index df9d4bf48..d1ce8720d 100644
--- a/frontend/src/lib/types.ts
+++ b/frontend/src/lib/types.ts
@@ -1,4 +1,4 @@
-import { AlertColors } from "@/config/siteConfig";
+import type { AlertColors } from "@/config/site-config";
export type Script = {
name: string;
@@ -48,18 +48,18 @@ export type Metadata = {
categories: Category[];
};
-export interface Version {
+export type Version = {
name: string;
slug: string;
-}
+};
-export interface OperatingSystem {
+export type OperatingSystem = {
name: string;
versions: Version[];
-}
+};
-export interface AppVersion {
+export type AppVersion = {
name: string;
version: string;
date: Date;
-}
+};
diff --git a/frontend/src/lib/utils.ts b/frontend/src/lib/utils.ts
index a5ef19350..3f313e9e7 100644
--- a/frontend/src/lib/utils.ts
+++ b/frontend/src/lib/utils.ts
@@ -1,5 +1,7 @@
-import { clsx, type ClassValue } from "clsx";
+import type { ClassValue } from "clsx";
+
import { twMerge } from "tailwind-merge";
+import { clsx } from "clsx";
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs));
diff --git a/frontend/src/styles/globals.css b/frontend/src/styles/globals.css
index d9b891932..dfbd2954b 100644
--- a/frontend/src/styles/globals.css
+++ b/frontend/src/styles/globals.css
@@ -2,7 +2,6 @@
@tailwind components;
@tailwind utilities;
-
@layer base {
:root {
--background: 0 0% 100%;
@@ -92,4 +91,4 @@
.glass {
backdrop-filter: blur(15px) saturate(100%);
-webkit-backdrop-filter: blur(15px) saturate(100%);
-}
\ No newline at end of file
+}
diff --git a/frontend/tailwind.config.ts b/frontend/tailwind.config.ts
index 0a9bddc8f..f4a771181 100644
--- a/frontend/tailwind.config.ts
+++ b/frontend/tailwind.config.ts
@@ -1,10 +1,11 @@
+/* eslint-disable ts/no-require-imports */
+//
import type { Config } from "tailwindcss";
-const svgToDataUri = require("mini-svg-data-uri");
-
const {
default: flattenColorPalette,
} = require("tailwindcss/lib/util/flattenColorPalette");
+const svgToDataUri = require("mini-svg-data-uri");
const config = {
darkMode: ["class"],
@@ -73,11 +74,11 @@ const config = {
from: { height: "var(--radix-accordion-content-height)" },
to: { height: "0" },
},
- shine: {
+ "shine": {
from: { backgroundPosition: "200% 0" },
to: { backgroundPosition: "-200% 0" },
},
- gradient: {
+ "gradient": {
to: {
backgroundPosition: "var(--bg-size) 0",
},
@@ -89,11 +90,11 @@ const config = {
"50%": {
"background-position": "100% 100%",
},
- to: {
+ "to": {
"background-position": "0% 0%",
},
},
- moveHorizontal: {
+ "moveHorizontal": {
"0%": {
transform: "translateX(-50%) translateY(-10%)",
},
@@ -104,7 +105,7 @@ const config = {
transform: "translateX(-50%) translateY(-10%)",
},
},
- moveInCircle: {
+ "moveInCircle": {
"0%": {
transform: "rotate(0deg)",
},
@@ -115,7 +116,7 @@ const config = {
transform: "rotate(360deg)",
},
},
- moveVertical: {
+ "moveVertical": {
"0%": {
transform: "translateY(-50%)",
},
@@ -130,8 +131,8 @@ const config = {
animation: {
"accordion-down": "accordion-down 0.2s ease-out",
"accordion-up": "accordion-up 0.2s ease-out",
- shine: "shine 8s ease-in-out infinite",
- gradient: "gradient 8s linear infinite",
+ "shine": "shine 8s ease-in-out infinite",
+ "gradient": "gradient 8s linear infinite",
},
},
},
@@ -168,8 +169,8 @@ const config = {
} satisfies Config;
function addVariablesForColors({ addBase, theme }: any) {
- let allColors = flattenColorPalette(theme("colors"));
- let newVars = Object.fromEntries(
+ const allColors = flattenColorPalette(theme("colors"));
+ const newVars = Object.fromEntries(
Object.entries(allColors).map(([key, val]) => [`--${key}`, val]),
);
addBase({
diff --git a/frontend/tsconfig.json b/frontend/tsconfig.json
index 195f88b78..109f6b192 100644
--- a/frontend/tsconfig.json
+++ b/frontend/tsconfig.json
@@ -1,32 +1,32 @@
{
"compilerOptions": {
+ "incremental": true,
+ "target": "ES2017",
+ "jsx": "preserve",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
- "allowJs": true,
- "skipLibCheck": true,
- "strict": true,
- "noEmit": true,
- "esModuleInterop": true,
"module": "esnext",
"moduleResolution": "bundler",
- "resolveJsonModule": true,
- "isolatedModules": true,
- "jsx": "preserve",
- "incremental": true,
- "plugins": [
- {
- "name": "next"
- }
- ],
"paths": {
"@/*": [
"./src/*"
]
},
- "target": "ES2017"
+ "resolveJsonModule": true,
+ "allowJs": true,
+ "strict": true,
+ "noEmit": true,
+ "esModuleInterop": true,
+ "isolatedModules": true,
+ "skipLibCheck": true,
+ "plugins": [
+ {
+ "name": "next"
+ }
+ ]
},
"include": [
"next-env.d.ts",
diff --git a/frontend/vitest.config.mjs b/frontend/vitest.config.mjs
index f37e9966c..8d815eea8 100644
--- a/frontend/vitest.config.mjs
+++ b/frontend/vitest.config.mjs
@@ -1,11 +1,11 @@
-import { defineConfig } from 'vitest/config'
-import react from '@vitejs/plugin-react'
-import tsconfigPaths from 'vite-tsconfig-paths'
-
+import tsconfigPaths from "vite-tsconfig-paths";
+import { defineConfig } from "vitest/config";
+import react from "@vitejs/plugin-react";
+
export default defineConfig({
plugins: [tsconfigPaths(), react()],
test: {
environment: "jsdom",
- setupFiles: ["src/__tests__/setupTests.ts"]
+ setupFiles: ["src/__tests__/setupTests.ts"],
},
-})
\ No newline at end of file
+});