mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-25 19:15:18 +02:00
fix: connector card UI improvements
This commit is contained in:
parent
5f0013c109
commit
4de28152d5
3 changed files with 15 additions and 8 deletions
|
|
@ -17,6 +17,7 @@ interface ConnectorCardProps {
|
||||||
isConnected?: boolean;
|
isConnected?: boolean;
|
||||||
isConnecting?: boolean;
|
isConnecting?: boolean;
|
||||||
documentCount?: number;
|
documentCount?: number;
|
||||||
|
accountCount?: number;
|
||||||
lastIndexedAt?: string | null;
|
lastIndexedAt?: string | null;
|
||||||
isIndexing?: boolean;
|
isIndexing?: boolean;
|
||||||
activeTask?: LogActiveTask;
|
activeTask?: LogActiveTask;
|
||||||
|
|
@ -96,6 +97,7 @@ export const ConnectorCard: FC<ConnectorCardProps> = ({
|
||||||
isConnected = false,
|
isConnected = false,
|
||||||
isConnecting = false,
|
isConnecting = false,
|
||||||
documentCount,
|
documentCount,
|
||||||
|
accountCount,
|
||||||
lastIndexedAt,
|
lastIndexedAt,
|
||||||
isIndexing = false,
|
isIndexing = false,
|
||||||
activeTask,
|
activeTask,
|
||||||
|
|
@ -154,8 +156,14 @@ export const ConnectorCard: FC<ConnectorCardProps> = ({
|
||||||
</div>
|
</div>
|
||||||
<div className="text-[10px] text-muted-foreground mt-1">{getStatusContent()}</div>
|
<div className="text-[10px] text-muted-foreground mt-1">{getStatusContent()}</div>
|
||||||
{isConnected && documentCount !== undefined && (
|
{isConnected && documentCount !== undefined && (
|
||||||
<p className="text-[10px] text-muted-foreground mt-0.5">
|
<p className="text-[10px] text-muted-foreground mt-0.5 flex items-center gap-1.5">
|
||||||
{formatDocumentCount(documentCount)}
|
<span>{formatDocumentCount(documentCount)}</span>
|
||||||
|
{accountCount !== undefined && accountCount > 0 && (
|
||||||
|
<>
|
||||||
|
<span className="text-muted-foreground/50">•</span>
|
||||||
|
<span>{accountCount} {accountCount === 1 ? "Account" : "Accounts"}</span>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
</p>
|
</p>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -200,10 +200,6 @@ export const ActiveConnectorsTab: FC<ActiveConnectorsTabProps> = ({
|
||||||
: "bg-slate-400/5 dark:bg-white/5 hover:bg-slate-400/10 dark:hover:bg-white/10"
|
: "bg-slate-400/5 dark:bg-white/5 hover:bg-slate-400/10 dark:hover:bg-white/10"
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
{/* Account count badge */}
|
|
||||||
<div className="absolute -top-2 -right-2 flex h-5 items-center justify-center rounded-md bg-primary px-2 text-[10px] font-semibold text-primary-foreground whitespace-nowrap">
|
|
||||||
{accountCount > 99 ? "99+" : accountCount} {accountCount === 1 ? "Account" : "Accounts"}
|
|
||||||
</div>
|
|
||||||
<div
|
<div
|
||||||
className={cn(
|
className={cn(
|
||||||
"flex h-12 w-12 items-center justify-center rounded-lg border shrink-0",
|
"flex h-12 w-12 items-center justify-center rounded-lg border shrink-0",
|
||||||
|
|
@ -230,8 +226,10 @@ export const ActiveConnectorsTab: FC<ActiveConnectorsTabProps> = ({
|
||||||
: "Never indexed"}
|
: "Never indexed"}
|
||||||
</p>
|
</p>
|
||||||
)}
|
)}
|
||||||
<p className="text-[10px] text-muted-foreground mt-0.5">
|
<p className="text-[10px] text-muted-foreground mt-0.5 flex items-center gap-1.5">
|
||||||
{formatDocumentCount(documentCount)}
|
<span>{formatDocumentCount(documentCount)}</span>
|
||||||
|
<span className="text-muted-foreground/50">•</span>
|
||||||
|
<span>{accountCount} {accountCount === 1 ? "Account" : "Accounts"}</span>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<Button
|
<Button
|
||||||
|
|
|
||||||
|
|
@ -147,6 +147,7 @@ export const AllConnectorsTab: FC<AllConnectorsTabProps> = ({
|
||||||
isConnected={isConnected}
|
isConnected={isConnected}
|
||||||
isConnecting={isConnecting}
|
isConnecting={isConnecting}
|
||||||
documentCount={documentCount}
|
documentCount={documentCount}
|
||||||
|
accountCount={typeConnectors.length}
|
||||||
lastIndexedAt={mostRecentLastIndexed}
|
lastIndexedAt={mostRecentLastIndexed}
|
||||||
isIndexing={isIndexing}
|
isIndexing={isIndexing}
|
||||||
activeTask={activeTask}
|
activeTask={activeTask}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue