chore: linting

This commit is contained in:
DESKTOP-RTLN3BA\$punk 2026-01-12 14:17:15 -08:00
parent 11915df97b
commit 73a57589ac
25 changed files with 184 additions and 181 deletions

View file

@ -6,9 +6,9 @@ export type {
NavItem,
NoteItem,
PageUsage,
SearchSpace,
SidebarSectionProps,
User,
SearchSpace,
} from "./types/layout.types";
export {
AllSearchSpacesSheet,
@ -23,10 +23,10 @@ export {
NavSection,
NoteListItem,
PageUsageDisplay,
SearchSpaceAvatar,
Sidebar,
SidebarCollapseButton,
SidebarHeader,
SidebarSection,
SidebarUserProfile,
SearchSpaceAvatar,
} from "./ui";

View file

@ -28,8 +28,8 @@ import { resetUser, trackLogout } from "@/lib/posthog/events";
import { cacheKeys } from "@/lib/query-client/cache-keys";
import type { ChatItem, NavItem, NoteItem, SearchSpace } from "../types/layout.types";
import { CreateSearchSpaceDialog } from "../ui/dialogs";
import { LayoutShell } from "../ui/shell";
import { AllSearchSpacesSheet } from "../ui/sheets";
import { LayoutShell } from "../ui/shell";
import { AllChatsSidebar } from "../ui/sidebar/AllChatsSidebar";
import { AllNotesSidebar } from "../ui/sidebar/AllNotesSidebar";

View file

@ -104,11 +104,7 @@ export function CreateSearchSpaceDialog({ open, onOpenChange }: CreateSearchSpac
<FormItem>
<FormLabel>{t("name_label")}</FormLabel>
<FormControl>
<Input
placeholder={t("name_placeholder")}
{...field}
autoFocus
/>
<Input placeholder={t("name_placeholder")} {...field} autoFocus />
</FormControl>
<FormMessage />
</FormItem>
@ -163,4 +159,3 @@ export function CreateSearchSpaceDialog({ open, onOpenChange }: CreateSearchSpac
</Dialog>
);
}

View file

@ -1,2 +1 @@
export { CreateSearchSpaceDialog } from "./CreateSearchSpaceDialog";

View file

@ -42,7 +42,12 @@ function getInitials(name: string): string {
return name.slice(0, 2).toUpperCase();
}
export function SearchSpaceAvatar({ name, isActive, onClick, size = "md" }: SearchSpaceAvatarProps) {
export function SearchSpaceAvatar({
name,
isActive,
onClick,
size = "md",
}: SearchSpaceAvatarProps) {
const bgColor = stringToColor(name);
const initials = getInitials(name);
const sizeClasses = size === "sm" ? "h-8 w-8 text-xs" : "h-10 w-10 text-sm";

View file

@ -1,8 +1,8 @@
export { CreateSearchSpaceDialog } from "./dialogs";
export { Header } from "./header";
export { IconRail, NavIcon, SearchSpaceAvatar } from "./icon-rail";
export { LayoutShell } from "./shell";
export { AllSearchSpacesSheet } from "./sheets";
export { LayoutShell } from "./shell";
export {
ChatListItem,
MobileSidebar,

View file

@ -1,6 +1,15 @@
"use client";
import { Calendar, MoreHorizontal, Search, Settings, Share2, Trash2, UserCheck, Users } from "lucide-react";
import {
Calendar,
MoreHorizontal,
Search,
Settings,
Share2,
Trash2,
UserCheck,
Users,
} from "lucide-react";
import { useTranslations } from "next-intl";
import { useState } from "react";
import {
@ -112,9 +121,7 @@ export function AllSearchSpacesSheet({
</div>
<div className="flex flex-col gap-1">
<p className="font-medium">{t("no_search_spaces")}</p>
<p className="text-sm text-muted-foreground">
{t("create_first_search_space")}
</p>
<p className="text-sm text-muted-foreground">{t("create_first_search_space")}</p>
</div>
{onCreateNew && (
<Button onClick={onCreateNew} className="mt-2">
@ -132,9 +139,7 @@ export function AllSearchSpacesSheet({
>
<div className="flex items-start justify-between gap-2">
<div className="flex flex-1 flex-col gap-1">
<span className="font-medium leading-tight">
{space.name}
</span>
<span className="font-medium leading-tight">{space.name}</span>
{space.description && (
<span className="text-sm text-muted-foreground line-clamp-2">
{space.description}
@ -143,42 +148,42 @@ export function AllSearchSpacesSheet({
</div>
<div className="flex shrink-0 items-center gap-2">
{space.memberCount > 1 && (
<Badge variant="outline" className="shrink-0">
<Share2 className="mr-1 h-3 w-3" />
{tCommon("shared")}
</Badge>
)}
{space.memberCount > 1 && (
<Badge variant="outline" className="shrink-0">
<Share2 className="mr-1 h-3 w-3" />
{tCommon("shared")}
</Badge>
)}
{space.isOwner && (
<DropdownMenu>
<DropdownMenuTrigger asChild>
<Button
variant="ghost"
size="icon"
className="h-6 w-6 shrink-0"
onClick={(e) => e.stopPropagation()}
>
<MoreHorizontal className="h-4 w-4" />
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent align="end">
<DropdownMenuItem onClick={(e) => handleSettings(e, space)}>
<Settings className="mr-2 h-4 w-4" />
{tCommon("settings")}
</DropdownMenuItem>
<DropdownMenuSeparator />
<DropdownMenuItem
onClick={(e) => handleDeleteClick(e, space)}
className="text-destructive focus:text-destructive"
>
<Trash2 className="mr-2 h-4 w-4" />
{tCommon("delete")}
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
)}
</div>
{space.isOwner && (
<DropdownMenu>
<DropdownMenuTrigger asChild>
<Button
variant="ghost"
size="icon"
className="h-6 w-6 shrink-0"
onClick={(e) => e.stopPropagation()}
>
<MoreHorizontal className="h-4 w-4" />
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent align="end">
<DropdownMenuItem onClick={(e) => handleSettings(e, space)}>
<Settings className="mr-2 h-4 w-4" />
{tCommon("settings")}
</DropdownMenuItem>
<DropdownMenuSeparator />
<DropdownMenuItem
onClick={(e) => handleDeleteClick(e, space)}
className="text-destructive focus:text-destructive"
>
<Trash2 className="mr-2 h-4 w-4" />
{tCommon("delete")}
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
)}
</div>
</div>
<div className="flex items-center gap-4 text-xs text-muted-foreground">

View file

@ -1,2 +1 @@
export { AllSearchSpacesSheet } from "./AllSearchSpacesSheet";

View file

@ -10,8 +10,8 @@ import type {
NavItem,
NoteItem,
PageUsage,
User,
SearchSpace,
User,
} from "../../types/layout.types";
import { Header } from "../header";
import { IconRail } from "../icon-rail";

View file

@ -9,8 +9,8 @@ import type {
NavItem,
NoteItem,
PageUsage,
User,
SearchSpace,
User,
} from "../../types/layout.types";
import { IconRail } from "../icon-rail";
import { Sidebar } from "./Sidebar";

View file

@ -11,8 +11,8 @@ import type {
NavItem,
NoteItem,
PageUsage,
User,
SearchSpace,
User,
} from "../../types/layout.types";
import { ChatListItem } from "./ChatListItem";
import { NavSection } from "./NavSection";
@ -289,7 +289,12 @@ export function Sidebar({
<PageUsageDisplay pagesUsed={pageUsage.pagesUsed} pagesLimit={pageUsage.pagesLimit} />
)}
<SidebarUserProfile user={user} onUserSettings={onUserSettings} onLogout={onLogout} isCollapsed={isCollapsed} />
<SidebarUserProfile
user={user}
onUserSettings={onUserSettings}
onLogout={onLogout}
isCollapsed={isCollapsed}
/>
</div>
</div>
);

View file

@ -43,7 +43,9 @@ export function SidebarHeader({
isCollapsed ? "w-10" : "w-50"
)}
>
<span className="truncate text-base">{searchSpace?.name ?? t("select_search_space")}</span>
<span className="truncate text-base">
{searchSpace?.name ?? t("select_search_space")}
</span>
<ChevronsUpDown className="h-4 w-4 shrink-0 text-muted-foreground" />
</Button>
</DropdownMenuTrigger>