refactor: format code with prettier and fix quotation marks

This commit is contained in:
vffuunnyy
2025-08-16 15:23:43 +07:00
parent 9c33f007a1
commit e26f500ad0
32 changed files with 1636 additions and 1490 deletions

View File

@@ -1,16 +1,18 @@
import { Link } from 'react-router-dom';
import { Link } from "react-router-dom";
import {
Sidebar,
SidebarContent, SidebarFooter,
SidebarContent,
SidebarFooter,
SidebarGroup,
SidebarGroupContent,
SidebarHeader,
SidebarMenu,
SidebarMenuButton,
SidebarMenuItem, useSidebar,
} from "@/components/ui/sidebar"
import { t } from 'i18next';
import { cn } from '@root/lib/utils';
SidebarMenuItem,
useSidebar,
} from "@/components/ui/sidebar";
import { t } from "i18next";
import { cn } from "@root/lib/utils";
import {
Home,
@@ -19,21 +21,22 @@ import {
Cable,
ListChecks,
FileText,
Settings, EarthLock,
} from 'lucide-react';
Settings,
EarthLock,
} from "lucide-react";
import { UpdateButton } from "@/components/layout/update-button";
import React from "react";
import { SheetClose } from '@/components/ui/sheet';
import logo from "@/assets/image/logo.png"
import { SheetClose } from "@/components/ui/sheet";
import logo from "@/assets/image/logo.png";
const menuItems = [
{ title: 'Home', url: '/home', icon: Home },
{ title: 'Profiles', url: '/profile', icon: Users },
{ title: 'Proxies', url: '/proxies', icon: Server },
{ title: 'Connections', url: '/connections', icon: Cable },
{ title: 'Rules', url: '/rules', icon: ListChecks },
{ title: 'Logs', url: '/logs', icon: FileText },
{ title: 'Settings', url: '/settings', icon: Settings },
{ title: "Home", url: "/home", icon: Home },
{ title: "Profiles", url: "/profile", icon: Users },
{ title: "Proxies", url: "/proxies", icon: Server },
{ title: "Connections", url: "/connections", icon: Cable },
{ title: "Rules", url: "/rules", icon: ListChecks },
{ title: "Logs", url: "/logs", icon: FileText },
{ title: "Settings", url: "/settings", icon: Settings },
];
export function AppSidebar() {
@@ -41,18 +44,15 @@ export function AppSidebar() {
return (
<Sidebar variant="floating" collapsible="icon">
<SidebarHeader>
<SidebarMenuButton size="lg"
<SidebarMenuButton
size="lg"
className={cn(
"flex h-12 items-center transition-all duration-200",
"group-data-[state=expanded]:w-full group-data-[state=expanded]:gap-2 group-data-[state=expanded]:px-3",
"group-data-[state=collapsed]:w-full group-data-[state=collapsed]:justify-center"
"group-data-[state=collapsed]:w-full group-data-[state=collapsed]:justify-center",
)}
>
<img
src={logo}
alt="logo"
className="h-6 w-6 flex-shrink-0"
/>
<img src={logo} alt="logo" className="h-6 w-6 flex-shrink-0" />
<span className="font-semibold whitespace-nowrap group-data-[state=collapsed]:hidden">
Koala Clash
</span>
@@ -69,30 +69,29 @@ export function AppSidebar() {
key={item.title}
to={item.url}
className={cn(
'flex items-center gap-3 rounded-lg px-3 py-2 text-muted-foreground transition-all hover:text-primary',
'data-[active=true]:font-semibold data-[active=true]:border'
"flex items-center gap-3 rounded-lg px-3 py-2 text-muted-foreground transition-all hover:text-primary",
"data-[active=true]:font-semibold data-[active=true]:border",
)}
>
<item.icon className="h-4 w-4 drop-shadow-md" />
{t(item.title)}
</Link>
)
);
return (
<SidebarMenuItem key={item.title} className="my-1">
<SidebarMenuButton
asChild
isActive={isActive}
tooltip={t(item.title)}>
{isMobile ? (
<SheetClose asChild>
{linkElement}
</SheetClose>
<SidebarMenuItem key={item.title} className="my-1">
<SidebarMenuButton
asChild
isActive={isActive}
tooltip={t(item.title)}
>
{isMobile ? (
<SheetClose asChild>{linkElement}</SheetClose>
) : (
linkElement
)}
</SidebarMenuButton>
</SidebarMenuItem>
)
</SidebarMenuButton>
</SidebarMenuItem>
);
})}
</SidebarMenu>
</SidebarGroupContent>
@@ -104,5 +103,5 @@ export function AppSidebar() {
</div>
</SidebarFooter>
</Sidebar>
)
);
}