diff --git a/surfsense_web/components/assistant-ui/connector-popup/connector-configs/components/teams-config 2.tsx b/surfsense_web/components/assistant-ui/connector-popup/connector-configs/components/teams-config 2.tsx deleted file mode 100644 index ac08a6c03..000000000 --- a/surfsense_web/components/assistant-ui/connector-popup/connector-configs/components/teams-config 2.tsx +++ /dev/null @@ -1,29 +0,0 @@ -"use client"; - -import { Info } from "lucide-react"; -import type { FC } from "react"; -import type { ConnectorConfigProps } from "../index"; - -export interface TeamsConfigProps extends ConnectorConfigProps { - onNameChange?: (name: string) => void; -} - -export const TeamsConfig: FC = () => { - return ( -
-
-
- -
-
-

Microsoft Teams Access

-

- SurfSense will index messages from Teams channels that you have access to. The app can - only read messages from teams and channels where you are a member. Make sure you're a - member of the teams you want to index before connecting. -

-
-
-
- ); -}; diff --git a/surfsense_web/components/assistant-ui/connector-popup/views/connector-accounts-list-view 2.tsx b/surfsense_web/components/assistant-ui/connector-popup/views/connector-accounts-list-view 2.tsx deleted file mode 100644 index e45f24d11..000000000 --- a/surfsense_web/components/assistant-ui/connector-popup/views/connector-accounts-list-view 2.tsx +++ /dev/null @@ -1,189 +0,0 @@ -"use client"; - -import { differenceInDays, differenceInMinutes, format, isToday, isYesterday } from "date-fns"; -import { ArrowLeft, Loader2, Plus } from "lucide-react"; -import type { FC } from "react"; -import { Button } from "@/components/ui/button"; -import { getConnectorIcon } from "@/contracts/enums/connectorIcons"; -import type { SearchSourceConnector } from "@/contracts/types/connector.types"; -import type { LogActiveTask, LogSummary } from "@/contracts/types/log.types"; -import { cn } from "@/lib/utils"; -import { getConnectorDisplayName } from "../tabs/all-connectors-tab"; - -interface ConnectorAccountsListViewProps { - connectorType: string; - connectorTitle: string; - connectors: SearchSourceConnector[]; - indexingConnectorIds: Set; - logsSummary: LogSummary | undefined; - onBack: () => void; - onManage: (connector: SearchSourceConnector) => void; - onAddAccount: () => void; - isConnecting?: boolean; -} - -/** - * Format last indexed date with contextual messages - */ -function formatLastIndexedDate(dateString: string): string { - const date = new Date(dateString); - const now = new Date(); - const minutesAgo = differenceInMinutes(now, date); - const daysAgo = differenceInDays(now, date); - - if (minutesAgo < 1) { - return "Just now"; - } - - if (minutesAgo < 60) { - return `${minutesAgo} ${minutesAgo === 1 ? "minute" : "minutes"} ago`; - } - - if (isToday(date)) { - return `Today at ${format(date, "h:mm a")}`; - } - - if (isYesterday(date)) { - return `Yesterday at ${format(date, "h:mm a")}`; - } - - if (daysAgo < 7) { - return `${daysAgo} ${daysAgo === 1 ? "day" : "days"} ago`; - } - - return format(date, "MMM d, yyyy"); -} - -export const ConnectorAccountsListView: FC = ({ - connectorType, - connectorTitle, - connectors, - indexingConnectorIds, - logsSummary, - onBack, - onManage, - onAddAccount, - isConnecting = false, -}) => { - // Filter connectors to only show those of this type - const typeConnectors = connectors.filter((c) => c.connector_type === connectorType); - - return ( -
- {/* Header */} -
-
-
- -
-
- {getConnectorIcon(connectorType, "size-5")} -
-
-

{connectorTitle} Accounts

-

- {typeConnectors.length} connected account{typeConnectors.length !== 1 ? "s" : ""} -

-
-
-
- {/* Add Account Button with dashed border */} - -
-
- - {/* Content */} -
- {/* Connected Accounts Grid */} -
- {typeConnectors.map((connector) => { - const isIndexing = indexingConnectorIds.has(connector.id); - const activeTask = logsSummary?.active_tasks?.find( - (task: LogActiveTask) => task.connector_id === connector.id - ); - - return ( -
-
- {getConnectorIcon(connector.connector_type, "size-6")} -
-
-

- {getConnectorDisplayName(connector.name)} -

- {isIndexing ? ( -

- - Indexing... - {activeTask?.message && ( - - • {activeTask.message} - - )} -

- ) : ( -

- {connector.last_indexed_at - ? `Last indexed: ${formatLastIndexedDate(connector.last_indexed_at)}` - : "Never indexed"} -

- )} -
- -
- ); - })} -
-
-
- ); -};