Skip to content

Remove unnecessary "use client" from pure data/utility modules #1153

@MODSetter

Description

@MODSetter

Description

Several modules have "use client" but only export constants, types, or pure functions with no hooks, event handlers, or browser APIs. This unnecessarily ties them to the client bundle.

Files to change

1. surfsense_web/components/assistant-ui/connector-popup/utils/connector-document-mapping.ts (line 1)

Exports only a Record<string, string> constant and a pure function. No hooks or browser APIs.

Fix: Remove "use client".

2. surfsense_web/app/docs/sidebar-separator.tsx (line 1)

Purely presentational component with no hooks, state, or event handlers:

export function SidebarSeparator({ item }: { item: Separator }) {
  return <p className="..."> {item.icon} {item.name} </p>;
}

Fix: Remove "use client" (verify item.icon is serializable in Fumadocs context).

3. surfsense_web/app/dashboard/[search_space_id]/logs/loading.tsx (line 1)

Loading skeleton uses Framer Motion but only for entrance animation. Could use Tailwind's animate-pulse instead.

Fix: Replace motion.* with plain elements + Skeleton (matching new-chat/loading.tsx pattern) and remove "use client".

Acceptance criteria

  • Listed files work correctly without "use client"
  • No hooks or browser API usage in these files
  • next build succeeds

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions