mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-31 19:45:15 +02:00
chore: ran linting
This commit is contained in:
parent
171bec9ef7
commit
4fb1b10cdc
4 changed files with 109 additions and 103 deletions
|
|
@ -37,9 +37,9 @@ import {
|
||||||
import { Input } from "@/components/ui/input";
|
import { Input } from "@/components/ui/input";
|
||||||
import { isPageLimitExceededMetadata } from "@/contracts/types/inbox.types";
|
import { isPageLimitExceededMetadata } from "@/contracts/types/inbox.types";
|
||||||
import { useAnnouncements } from "@/hooks/use-announcements";
|
import { useAnnouncements } from "@/hooks/use-announcements";
|
||||||
import { useIsMobile } from "@/hooks/use-mobile";
|
|
||||||
import { useDocumentsProcessing } from "@/hooks/use-documents-processing";
|
import { useDocumentsProcessing } from "@/hooks/use-documents-processing";
|
||||||
import { useInbox } from "@/hooks/use-inbox";
|
import { useInbox } from "@/hooks/use-inbox";
|
||||||
|
import { useIsMobile } from "@/hooks/use-mobile";
|
||||||
import { notificationsApiService } from "@/lib/apis/notifications-api.service";
|
import { notificationsApiService } from "@/lib/apis/notifications-api.service";
|
||||||
import { searchSpacesApiService } from "@/lib/apis/search-spaces-api.service";
|
import { searchSpacesApiService } from "@/lib/apis/search-spaces-api.service";
|
||||||
import { logout } from "@/lib/auth-utils";
|
import { logout } from "@/lib/auth-utils";
|
||||||
|
|
@ -316,13 +316,15 @@ export function LayoutDataProvider({ searchSpaceId, children }: LayoutDataProvid
|
||||||
isActive: isInboxSidebarOpen,
|
isActive: isInboxSidebarOpen,
|
||||||
badge: totalUnreadCount > 0 ? formatInboxCount(totalUnreadCount) : undefined,
|
badge: totalUnreadCount > 0 ? formatInboxCount(totalUnreadCount) : undefined,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "Documents",
|
title: "Documents",
|
||||||
url: "#documents",
|
url: "#documents",
|
||||||
icon: SquareLibrary,
|
icon: SquareLibrary,
|
||||||
isActive: isMobile ? isDocumentsSidebarOpen : (isDocumentsSidebarOpen && !isRightPanelCollapsed),
|
isActive: isMobile
|
||||||
statusIndicator: documentsProcessingStatus,
|
? isDocumentsSidebarOpen
|
||||||
},
|
: isDocumentsSidebarOpen && !isRightPanelCollapsed,
|
||||||
|
statusIndicator: documentsProcessingStatus,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: "Announcements",
|
title: "Announcements",
|
||||||
url: "#announcements",
|
url: "#announcements",
|
||||||
|
|
@ -331,16 +333,16 @@ export function LayoutDataProvider({ searchSpaceId, children }: LayoutDataProvid
|
||||||
badge: announcementUnreadCount > 0 ? formatInboxCount(announcementUnreadCount) : undefined,
|
badge: announcementUnreadCount > 0 ? formatInboxCount(announcementUnreadCount) : undefined,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
isMobile,
|
isMobile,
|
||||||
isInboxSidebarOpen,
|
isInboxSidebarOpen,
|
||||||
isDocumentsSidebarOpen,
|
isDocumentsSidebarOpen,
|
||||||
isRightPanelCollapsed,
|
isRightPanelCollapsed,
|
||||||
totalUnreadCount,
|
totalUnreadCount,
|
||||||
isAnnouncementsSidebarOpen,
|
isAnnouncementsSidebarOpen,
|
||||||
announcementUnreadCount,
|
announcementUnreadCount,
|
||||||
documentsProcessingStatus,
|
documentsProcessingStatus,
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
// Handlers
|
// Handlers
|
||||||
|
|
|
||||||
|
|
@ -54,8 +54,8 @@ export function RightPanelExpandButton() {
|
||||||
<Button
|
<Button
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
size="icon"
|
size="icon"
|
||||||
onClick={() => startTransition(() => setCollapsed(false))}
|
onClick={() => startTransition(() => setCollapsed(false))}
|
||||||
className="h-8 w-8 shrink-0"
|
className="h-8 w-8 shrink-0"
|
||||||
>
|
>
|
||||||
<PanelRight className="h-4 w-4" />
|
<PanelRight className="h-4 w-4" />
|
||||||
<span className="sr-only">Expand panel</span>
|
<span className="sr-only">Expand panel</span>
|
||||||
|
|
@ -109,57 +109,57 @@ export function RightPanel({ documentsPanel }: RightPanelProps) {
|
||||||
return (
|
return (
|
||||||
<AnimatePresence>
|
<AnimatePresence>
|
||||||
{isVisible && (
|
{isVisible && (
|
||||||
<motion.aside
|
<motion.aside
|
||||||
key="right-panel"
|
key="right-panel"
|
||||||
initial={{ width: 0, opacity: 0 }}
|
initial={{ width: 0, opacity: 0 }}
|
||||||
animate={{ width: targetWidth, opacity: 1 }}
|
animate={{ width: targetWidth, opacity: 1 }}
|
||||||
exit={{ width: 0, opacity: 0 }}
|
exit={{ width: 0, opacity: 0 }}
|
||||||
transition={{
|
transition={{
|
||||||
width: { type: "spring", stiffness: 400, damping: 35, mass: 0.8 },
|
width: { type: "spring", stiffness: 400, damping: 35, mass: 0.8 },
|
||||||
opacity: { duration: 0.2, ease: "easeOut" },
|
opacity: { duration: 0.2, ease: "easeOut" },
|
||||||
}}
|
}}
|
||||||
style={{ willChange: "width, opacity", contain: "layout style" }}
|
style={{ willChange: "width, opacity", contain: "layout style" }}
|
||||||
className="flex h-full shrink-0 flex-col border-l bg-background overflow-hidden"
|
className="flex h-full shrink-0 flex-col border-l bg-background overflow-hidden"
|
||||||
>
|
>
|
||||||
<div className="relative flex-1 min-h-0 overflow-hidden">
|
<div className="relative flex-1 min-h-0 overflow-hidden">
|
||||||
<AnimatePresence mode="popLayout" initial={false}>
|
<AnimatePresence mode="popLayout" initial={false}>
|
||||||
{contentKey === "sources" && documentsPanel && (
|
{contentKey === "sources" && documentsPanel && (
|
||||||
<motion.div
|
<motion.div
|
||||||
key="sources"
|
key="sources"
|
||||||
initial={{ opacity: 0, x: 8 }}
|
initial={{ opacity: 0, x: 8 }}
|
||||||
animate={{ opacity: 1, x: 0 }}
|
animate={{ opacity: 1, x: 0 }}
|
||||||
exit={{ opacity: 0, x: -8 }}
|
exit={{ opacity: 0, x: -8 }}
|
||||||
transition={{ duration: 0.15, ease: "easeOut" }}
|
transition={{ duration: 0.15, ease: "easeOut" }}
|
||||||
className="h-full"
|
className="h-full"
|
||||||
>
|
>
|
||||||
<DocumentsSidebar
|
<DocumentsSidebar
|
||||||
open={documentsPanel.open}
|
open={documentsPanel.open}
|
||||||
onOpenChange={documentsPanel.onOpenChange}
|
onOpenChange={documentsPanel.onOpenChange}
|
||||||
embedded
|
embedded
|
||||||
headerAction={collapseButton}
|
headerAction={collapseButton}
|
||||||
/>
|
|
||||||
</motion.div>
|
|
||||||
)}
|
|
||||||
{contentKey === "report" && (
|
|
||||||
<motion.div
|
|
||||||
key="report"
|
|
||||||
initial={{ opacity: 0, x: 8 }}
|
|
||||||
animate={{ opacity: 1, x: 0 }}
|
|
||||||
exit={{ opacity: 0, x: -8 }}
|
|
||||||
transition={{ duration: 0.15, ease: "easeOut" }}
|
|
||||||
className="h-full"
|
|
||||||
>
|
|
||||||
<div className="flex h-full flex-col">
|
|
||||||
<ReportPanelContent
|
|
||||||
reportId={reportState.reportId!}
|
|
||||||
title={reportState.title || "Report"}
|
|
||||||
onClose={closeReport}
|
|
||||||
shareToken={reportState.shareToken}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</motion.div>
|
||||||
</motion.div>
|
)}
|
||||||
)}
|
{contentKey === "report" && (
|
||||||
</AnimatePresence>
|
<motion.div
|
||||||
|
key="report"
|
||||||
|
initial={{ opacity: 0, x: 8 }}
|
||||||
|
animate={{ opacity: 1, x: 0 }}
|
||||||
|
exit={{ opacity: 0, x: -8 }}
|
||||||
|
transition={{ duration: 0.15, ease: "easeOut" }}
|
||||||
|
className="h-full"
|
||||||
|
>
|
||||||
|
<div className="flex h-full flex-col">
|
||||||
|
<ReportPanelContent
|
||||||
|
reportId={reportState.reportId!}
|
||||||
|
title={reportState.title || "Report"}
|
||||||
|
onClose={closeReport}
|
||||||
|
shareToken={reportState.shareToken}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</motion.div>
|
||||||
|
)}
|
||||||
|
</AnimatePresence>
|
||||||
</div>
|
</div>
|
||||||
</motion.aside>
|
</motion.aside>
|
||||||
)}
|
)}
|
||||||
|
|
|
||||||
|
|
@ -277,38 +277,42 @@ export function LayoutShell({
|
||||||
|
|
||||||
{/* Main container with sidebar and content - relative for inbox positioning */}
|
{/* Main container with sidebar and content - relative for inbox positioning */}
|
||||||
<div className="relative flex flex-1 rounded-xl border bg-background overflow-hidden">
|
<div className="relative flex flex-1 rounded-xl border bg-background overflow-hidden">
|
||||||
<Sidebar
|
<Sidebar
|
||||||
searchSpace={searchSpace}
|
searchSpace={searchSpace}
|
||||||
isCollapsed={isCollapsed}
|
isCollapsed={isCollapsed}
|
||||||
onToggleCollapse={toggleCollapsed}
|
onToggleCollapse={toggleCollapsed}
|
||||||
navItems={navItems}
|
navItems={navItems}
|
||||||
onNavItemClick={onNavItemClick}
|
onNavItemClick={onNavItemClick}
|
||||||
chats={chats}
|
chats={chats}
|
||||||
sharedChats={sharedChats}
|
sharedChats={sharedChats}
|
||||||
activeChatId={activeChatId}
|
activeChatId={activeChatId}
|
||||||
onNewChat={onNewChat}
|
onNewChat={onNewChat}
|
||||||
onChatSelect={onChatSelect}
|
onChatSelect={onChatSelect}
|
||||||
onChatRename={onChatRename}
|
onChatRename={onChatRename}
|
||||||
onChatDelete={onChatDelete}
|
onChatDelete={onChatDelete}
|
||||||
onChatArchive={onChatArchive}
|
onChatArchive={onChatArchive}
|
||||||
onViewAllSharedChats={onViewAllSharedChats}
|
onViewAllSharedChats={onViewAllSharedChats}
|
||||||
onViewAllPrivateChats={onViewAllPrivateChats}
|
onViewAllPrivateChats={onViewAllPrivateChats}
|
||||||
user={user}
|
user={user}
|
||||||
onSettings={onSettings}
|
onSettings={onSettings}
|
||||||
onManageMembers={onManageMembers}
|
onManageMembers={onManageMembers}
|
||||||
onUserSettings={onUserSettings}
|
onUserSettings={onUserSettings}
|
||||||
onLogout={onLogout}
|
onLogout={onLogout}
|
||||||
pageUsage={pageUsage}
|
pageUsage={pageUsage}
|
||||||
theme={theme}
|
theme={theme}
|
||||||
setTheme={setTheme}
|
setTheme={setTheme}
|
||||||
className="hidden md:flex border-r shrink-0"
|
className="hidden md:flex border-r shrink-0"
|
||||||
isLoadingChats={isLoadingChats}
|
isLoadingChats={isLoadingChats}
|
||||||
sidebarWidth={sidebarWidth}
|
sidebarWidth={sidebarWidth}
|
||||||
onResizeMouseDown={onResizeMouseDown}
|
onResizeMouseDown={onResizeMouseDown}
|
||||||
isResizing={isResizing}
|
isResizing={isResizing}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<motion.main layout="position" style={{ contain: "inline-size" }} className="flex-1 flex flex-col min-w-0">
|
<motion.main
|
||||||
|
layout="position"
|
||||||
|
style={{ contain: "inline-size" }}
|
||||||
|
className="flex-1 flex flex-col min-w-0"
|
||||||
|
>
|
||||||
<Header />
|
<Header />
|
||||||
|
|
||||||
<div className={cn("flex-1", isChatPage ? "overflow-hidden" : "overflow-auto")}>
|
<div className={cn("flex-1", isChatPage ? "overflow-hidden" : "overflow-auto")}>
|
||||||
|
|
|
||||||
|
|
@ -178,8 +178,8 @@ export function DocumentsSidebar({
|
||||||
|
|
||||||
const documentsContent = (
|
const documentsContent = (
|
||||||
<>
|
<>
|
||||||
<div className="shrink-0 flex h-14 items-center px-4">
|
<div className="shrink-0 flex h-14 items-center px-4">
|
||||||
<div className="flex w-full items-center justify-between">
|
<div className="flex w-full items-center justify-between">
|
||||||
<div className="flex items-center gap-2">
|
<div className="flex items-center gap-2">
|
||||||
{isMobile && (
|
{isMobile && (
|
||||||
<Button
|
<Button
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue