From 90b190b8d5cd596b65f2d40d12187b91ccbf37da Mon Sep 17 00:00:00 2001 From: PhatPhuckDave Date: Sat, 9 Aug 2025 21:34:02 +0200 Subject: [PATCH] Code format --- frontend/src/components/Header.tsx | 16 ++++---- frontend/src/components/SignatureCard.tsx | 28 ++++++------- .../src/components/SignatureCategories.tsx | 6 +-- .../src/components/SignatureEditModal.tsx | 12 +++--- frontend/src/components/SignatureListItem.tsx | 23 +++++------ frontend/src/components/ui/badge.tsx | 2 +- frontend/src/components/ui/button.tsx | 2 +- frontend/src/components/ui/chart.tsx | 40 +++++++++---------- frontend/src/components/ui/command.tsx | 2 +- frontend/src/components/ui/label.tsx | 2 +- frontend/src/components/ui/scroll-area.tsx | 4 +- frontend/src/components/ui/select.tsx | 4 +- frontend/src/components/ui/sheet.tsx | 1 - frontend/src/components/ui/sidebar.tsx | 2 +- frontend/src/components/ui/textarea.tsx | 2 +- frontend/src/components/ui/toast.tsx | 2 +- frontend/src/components/ui/toggle-group.tsx | 4 +- frontend/src/components/ui/toggle.tsx | 2 +- frontend/src/hooks/use-toast.ts | 30 +++++++------- frontend/src/index.css | 10 +++-- frontend/src/lib/pbtypes.ts | 4 +- frontend/src/main.tsx | 6 +-- frontend/src/pages/RegionPage.tsx | 8 ++-- frontend/src/utils/securityColors.ts | 4 +- 24 files changed, 108 insertions(+), 108 deletions(-) diff --git a/frontend/src/components/Header.tsx b/frontend/src/components/Header.tsx index 4da707e..82275a5 100644 --- a/frontend/src/components/Header.tsx +++ b/frontend/src/components/Header.tsx @@ -2,12 +2,12 @@ import React, { useEffect, useState } from 'react'; import { useNavigate } from 'react-router-dom'; import { - Breadcrumb, - BreadcrumbItem, - BreadcrumbLink, - BreadcrumbList, - BreadcrumbPage, - BreadcrumbSeparator, + Breadcrumb, + BreadcrumbItem, + BreadcrumbLink, + BreadcrumbList, + BreadcrumbPage, + BreadcrumbSeparator, } from '@/components/ui/breadcrumb'; import { Button } from '@/components/ui/button'; import { toast } from '@/hooks/use-toast'; @@ -31,7 +31,7 @@ export const Header = ({ title, breadcrumbs = [] }: HeaderProps) => { try { const list = await ListCharacters(); setChars((list as any[]).map((c: any) => ({ character_id: c.character_id, character_name: c.character_name }))); - } catch {} + } catch { } }; useEffect(() => { @@ -84,7 +84,7 @@ export const Header = ({ title, breadcrumbs = [] }: HeaderProps) => { )} - +

{title}

diff --git a/frontend/src/components/SignatureCard.tsx b/frontend/src/components/SignatureCard.tsx index 15f3f8a..6028dcb 100644 --- a/frontend/src/components/SignatureCard.tsx +++ b/frontend/src/components/SignatureCard.tsx @@ -3,15 +3,15 @@ import { Card, CardContent } from "@/components/ui/card"; import { Badge } from "@/components/ui/badge"; import { Button } from "@/components/ui/button"; import { - AlertDialog, - AlertDialogAction, - AlertDialogCancel, - AlertDialogContent, - AlertDialogDescription, - AlertDialogFooter, - AlertDialogHeader, - AlertDialogTitle, - AlertDialogTrigger, + AlertDialog, + AlertDialogAction, + AlertDialogCancel, + AlertDialogContent, + AlertDialogDescription, + AlertDialogFooter, + AlertDialogHeader, + AlertDialogTitle, + AlertDialogTrigger, } from "@/components/ui/alert-dialog"; import { SigviewRecord as Signature } from "@/lib/pbtypes"; import { getSignatureMeta } from "@/hooks/useSignatureCategories"; @@ -52,7 +52,7 @@ export const SignatureCard = ({ signature, onDelete, onUpdate }: SignatureCardPr return ( <> - setIsEditModalOpen(true)} > @@ -60,15 +60,15 @@ export const SignatureCard = ({ signature, onDelete, onUpdate }: SignatureCardPr
{/* Type Badge - Most Important */}
- {meta.icon} {signature.type || 'Unknown Type'}
- + {/* Signature Name */}

@@ -82,7 +82,7 @@ export const SignatureCard = ({ signature, onDelete, onUpdate }: SignatureCardPr

)}
- + {/* Additional Info */}
diff --git a/frontend/src/components/SignatureCategories.tsx b/frontend/src/components/SignatureCategories.tsx index 1ae6ea8..eddbc04 100644 --- a/frontend/src/components/SignatureCategories.tsx +++ b/frontend/src/components/SignatureCategories.tsx @@ -53,9 +53,9 @@ export const SignatureCategories = ({ categories, onToggleCategory, onDelete, on
{category.signatures.map((signature) => ( - diff --git a/frontend/src/components/SignatureEditModal.tsx b/frontend/src/components/SignatureEditModal.tsx index fc0d126..67ec28e 100644 --- a/frontend/src/components/SignatureEditModal.tsx +++ b/frontend/src/components/SignatureEditModal.tsx @@ -1,12 +1,12 @@ import { useState } from "react"; import { Button } from "@/components/ui/button"; import { - Dialog, - DialogContent, - DialogDescription, - DialogFooter, - DialogHeader, - DialogTitle, + Dialog, + DialogContent, + DialogDescription, + DialogFooter, + DialogHeader, + DialogTitle, } from "@/components/ui/dialog"; import { Input } from "@/components/ui/input"; import { Label } from "@/components/ui/label"; diff --git a/frontend/src/components/SignatureListItem.tsx b/frontend/src/components/SignatureListItem.tsx index 7f193b1..746975b 100644 --- a/frontend/src/components/SignatureListItem.tsx +++ b/frontend/src/components/SignatureListItem.tsx @@ -2,15 +2,15 @@ import { useState } from "react"; import { Badge } from "@/components/ui/badge"; import { Button } from "@/components/ui/button"; import { - AlertDialog, - AlertDialogAction, - AlertDialogCancel, - AlertDialogContent, - AlertDialogDescription, - AlertDialogFooter, - AlertDialogHeader, - AlertDialogTitle, - AlertDialogTrigger, + AlertDialog, + AlertDialogAction, + AlertDialogCancel, + AlertDialogContent, + AlertDialogDescription, + AlertDialogFooter, + AlertDialogHeader, + AlertDialogTitle, + AlertDialogTrigger, } from "@/components/ui/alert-dialog"; import { Clock, AlertTriangle, Skull, Trash2 } from "lucide-react"; import { SigviewRecord as Signature } from "@/lib/pbtypes"; @@ -88,9 +88,8 @@ export const SignatureListItem = ({ signature, onDelete, onUpdate }: SignatureLi return ( <>
setIsEditModalOpen(true)} >
diff --git a/frontend/src/components/ui/badge.tsx b/frontend/src/components/ui/badge.tsx index f000e3e..b47f184 100644 --- a/frontend/src/components/ui/badge.tsx +++ b/frontend/src/components/ui/badge.tsx @@ -25,7 +25,7 @@ const badgeVariants = cva( export interface BadgeProps extends React.HTMLAttributes, - VariantProps {} + VariantProps { } function Badge({ className, variant, ...props }: BadgeProps) { return ( diff --git a/frontend/src/components/ui/button.tsx b/frontend/src/components/ui/button.tsx index 36496a2..1a8a509 100644 --- a/frontend/src/components/ui/button.tsx +++ b/frontend/src/components/ui/button.tsx @@ -35,7 +35,7 @@ const buttonVariants = cva( export interface ButtonProps extends React.ButtonHTMLAttributes, - VariantProps { + VariantProps { asChild?: boolean } diff --git a/frontend/src/components/ui/chart.tsx b/frontend/src/components/ui/chart.tsx index a21d77e..044ea3e 100644 --- a/frontend/src/components/ui/chart.tsx +++ b/frontend/src/components/ui/chart.tsx @@ -82,13 +82,13 @@ const ChartStyle = ({ id, config }: { id: string; config: ChartConfig }) => { ([theme, prefix]) => ` ${prefix} [data-chart=${id}] { ${colorConfig - .map(([key, itemConfig]) => { - const color = - itemConfig.theme?.[theme as keyof typeof itemConfig.theme] || - itemConfig.color - return color ? ` --color-${key}: ${color};` : null - }) - .join("\n")} + .map(([key, itemConfig]) => { + const color = + itemConfig.theme?.[theme as keyof typeof itemConfig.theme] || + itemConfig.color + return color ? ` --color-${key}: ${color};` : null + }) + .join("\n")} } ` ) @@ -103,13 +103,13 @@ const ChartTooltip = RechartsPrimitive.Tooltip const ChartTooltipContent = React.forwardRef< HTMLDivElement, React.ComponentProps & - React.ComponentProps<"div"> & { - hideLabel?: boolean - hideIndicator?: boolean - indicator?: "line" | "dot" | "dashed" - nameKey?: string - labelKey?: string - } + React.ComponentProps<"div"> & { + hideLabel?: boolean + hideIndicator?: boolean + indicator?: "line" | "dot" | "dashed" + nameKey?: string + labelKey?: string + } >( ( { @@ -259,10 +259,10 @@ const ChartLegend = RechartsPrimitive.Legend const ChartLegendContent = React.forwardRef< HTMLDivElement, React.ComponentProps<"div"> & - Pick & { - hideIcon?: boolean - nameKey?: string - } + Pick & { + hideIcon?: boolean + nameKey?: string + } >( ( { className, hideIcon = false, payload, verticalAlign = "bottom", nameKey }, @@ -326,8 +326,8 @@ function getPayloadConfigFromPayload( const payloadPayload = "payload" in payload && - typeof payload.payload === "object" && - payload.payload !== null + typeof payload.payload === "object" && + payload.payload !== null ? payload.payload : undefined diff --git a/frontend/src/components/ui/command.tsx b/frontend/src/components/ui/command.tsx index 56a0979..7f13c87 100644 --- a/frontend/src/components/ui/command.tsx +++ b/frontend/src/components/ui/command.tsx @@ -21,7 +21,7 @@ const Command = React.forwardRef< )) Command.displayName = CommandPrimitive.displayName -interface CommandDialogProps extends DialogProps {} +interface CommandDialogProps extends DialogProps { } const CommandDialog = ({ children, ...props }: CommandDialogProps) => { return ( diff --git a/frontend/src/components/ui/label.tsx b/frontend/src/components/ui/label.tsx index 683faa7..bd76bd9 100644 --- a/frontend/src/components/ui/label.tsx +++ b/frontend/src/components/ui/label.tsx @@ -11,7 +11,7 @@ const labelVariants = cva( const Label = React.forwardRef< React.ElementRef, React.ComponentPropsWithoutRef & - VariantProps + VariantProps >(({ className, ...props }, ref) => ( {children} diff --git a/frontend/src/components/ui/sheet.tsx b/frontend/src/components/ui/sheet.tsx index 7b1dbe4..fe07ff0 100644 --- a/frontend/src/components/ui/sheet.tsx +++ b/frontend/src/components/ui/sheet.tsx @@ -128,4 +128,3 @@ export { Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger } - diff --git a/frontend/src/components/ui/sidebar.tsx b/frontend/src/components/ui/sidebar.tsx index 1a566bf..38f1531 100644 --- a/frontend/src/components/ui/sidebar.tsx +++ b/frontend/src/components/ui/sidebar.tsx @@ -612,7 +612,7 @@ const SidebarMenuAction = React.forwardRef< "peer-data-[size=lg]/menu-button:top-2.5", "group-data-[collapsible=icon]:hidden", showOnHover && - "group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0", + "group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0", className )} {...props} diff --git a/frontend/src/components/ui/textarea.tsx b/frontend/src/components/ui/textarea.tsx index 9f9a6dc..7d450c9 100644 --- a/frontend/src/components/ui/textarea.tsx +++ b/frontend/src/components/ui/textarea.tsx @@ -3,7 +3,7 @@ import * as React from "react" import { cn } from "@/lib/utils" export interface TextareaProps - extends React.TextareaHTMLAttributes {} + extends React.TextareaHTMLAttributes { } const Textarea = React.forwardRef( ({ className, ...props }, ref) => { diff --git a/frontend/src/components/ui/toast.tsx b/frontend/src/components/ui/toast.tsx index a822477..4af2ace 100644 --- a/frontend/src/components/ui/toast.tsx +++ b/frontend/src/components/ui/toast.tsx @@ -41,7 +41,7 @@ const toastVariants = cva( const Toast = React.forwardRef< React.ElementRef, React.ComponentPropsWithoutRef & - VariantProps + VariantProps >(({ className, variant, ...props }, ref) => { return ( , React.ComponentPropsWithoutRef & - VariantProps + VariantProps >(({ className, variant, size, children, ...props }, ref) => ( , React.ComponentPropsWithoutRef & - VariantProps + VariantProps >(({ className, children, variant, size, ...props }, ref) => { const context = React.useContext(ToggleGroupContext) diff --git a/frontend/src/components/ui/toggle.tsx b/frontend/src/components/ui/toggle.tsx index 9ecac28..3565e72 100644 --- a/frontend/src/components/ui/toggle.tsx +++ b/frontend/src/components/ui/toggle.tsx @@ -29,7 +29,7 @@ const toggleVariants = cva( const Toggle = React.forwardRef< React.ElementRef, React.ComponentPropsWithoutRef & - VariantProps + VariantProps >(({ className, variant, size, ...props }, ref) => ( - } + type: ActionType["UPDATE_TOAST"] + toast: Partial + } | { - type: ActionType["DISMISS_TOAST"] - toastId?: ToasterToast["id"] - } + type: ActionType["DISMISS_TOAST"] + toastId?: ToasterToast["id"] + } | { - type: ActionType["REMOVE_TOAST"] - toastId?: ToasterToast["id"] - } + type: ActionType["REMOVE_TOAST"] + toastId?: ToasterToast["id"] + } interface State { toasts: ToasterToast[] @@ -104,9 +104,9 @@ export const reducer = (state: State, action: Action): State => { toasts: state.toasts.map((t) => t.id === toastId || toastId === undefined ? { - ...t, - open: false, - } + ...t, + open: false, + } : t ), } diff --git a/frontend/src/index.css b/frontend/src/index.css index 11b660d..6f7c196 100644 --- a/frontend/src/index.css +++ b/frontend/src/index.css @@ -1,5 +1,3 @@ - - @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap'); @tailwind base; @tailwind components; @@ -66,7 +64,9 @@ * { @apply border-border; } - html, body { + + html, + body { @apply bg-background text-foreground; height: 100vh; width: 100vw; @@ -74,12 +74,14 @@ margin: 0; padding: 0; } + body { font-family: 'Inter', system-ui, sans-serif; } + #root { height: 100vh; width: 100vw; overflow: hidden; } -} +} \ No newline at end of file diff --git a/frontend/src/lib/pbtypes.ts b/frontend/src/lib/pbtypes.ts index aaa2937..0ddda32 100644 --- a/frontend/src/lib/pbtypes.ts +++ b/frontend/src/lib/pbtypes.ts @@ -25,8 +25,8 @@ export type HTMLString = string type ExpandType = unknown extends T ? T extends unknown - ? { expand?: unknown } - : { expand: T } + ? { expand?: unknown } + : { expand: T } : { expand: T } // System fields diff --git a/frontend/src/main.tsx b/frontend/src/main.tsx index 719464e..9361073 100644 --- a/frontend/src/main.tsx +++ b/frontend/src/main.tsx @@ -1,5 +1,5 @@ -import { createRoot } from 'react-dom/client' -import App from './App.tsx' -import './index.css' +import { createRoot } from 'react-dom/client'; +import App from './App.tsx'; +import './index.css'; createRoot(document.getElementById("root")!).render(); diff --git a/frontend/src/pages/RegionPage.tsx b/frontend/src/pages/RegionPage.tsx index 1b3a1b6..6e07001 100644 --- a/frontend/src/pages/RegionPage.tsx +++ b/frontend/src/pages/RegionPage.tsx @@ -7,14 +7,14 @@ import { useNavigate } from 'react-router-dom'; export const RegionPage = () => { const { region } = useParams<{ region: string }>(); const navigate = useNavigate(); - + if (!region) { return (

Region Not Found

The requested region does not exist in our database.

-