mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-25 00:36:31 +02:00
chore: run biome lints
This commit is contained in:
parent
ee5d14c86c
commit
46bb52a444
5 changed files with 22 additions and 36 deletions
|
|
@ -26,7 +26,9 @@ import { notesApiService } from "@/lib/apis/notes-api.service";
|
|||
import { authenticatedFetch, getBearerToken, redirectToLogin } from "@/lib/auth-utils";
|
||||
|
||||
// BlockNote types
|
||||
type BlockNoteInlineContent = string | { text?: string; type?: string; styles?: Record<string, unknown> };
|
||||
type BlockNoteInlineContent =
|
||||
| string
|
||||
| { text?: string; type?: string; styles?: Record<string, unknown> };
|
||||
|
||||
interface BlockNoteBlock {
|
||||
type: string;
|
||||
|
|
|
|||
|
|
@ -41,23 +41,23 @@ const useAttachmentSrc = () => {
|
|||
const { file, src } = useAssistantState(
|
||||
useShallow(({ attachment }): { file?: File; src?: string } => {
|
||||
if (!attachment || attachment.type !== "image") return {};
|
||||
|
||||
|
||||
// First priority: use File object if available (for new uploads)
|
||||
if (attachment.file) return { file: attachment.file };
|
||||
|
||||
|
||||
// Second priority: use stored imageDataUrl (for persisted messages)
|
||||
// This is stored in our custom ChatAttachment interface
|
||||
const customAttachment = attachment as { imageDataUrl?: string };
|
||||
if (customAttachment.imageDataUrl) {
|
||||
return { src: customAttachment.imageDataUrl };
|
||||
}
|
||||
|
||||
|
||||
// Third priority: try to extract from content array (standard assistant-ui format)
|
||||
if (Array.isArray(attachment.content)) {
|
||||
const contentSrc = attachment.content.filter((c) => c.type === "image")[0]?.image;
|
||||
if (contentSrc) return { src: contentSrc };
|
||||
}
|
||||
|
||||
|
||||
return {};
|
||||
})
|
||||
);
|
||||
|
|
@ -297,9 +297,7 @@ const MessageAttachmentChip: FC = () => {
|
|||
};
|
||||
|
||||
export const UserMessageAttachments: FC = () => {
|
||||
return (
|
||||
<MessagePrimitive.Attachments components={{ Attachment: MessageAttachmentChip }} />
|
||||
);
|
||||
return <MessagePrimitive.Attachments components={{ Attachment: MessageAttachmentChip }} />;
|
||||
};
|
||||
|
||||
export const ComposerAttachments: FC = () => {
|
||||
|
|
|
|||
|
|
@ -505,7 +505,13 @@ const Composer: FC = () => {
|
|||
setMentionedDocuments([]);
|
||||
setMentionedDocumentIds([]);
|
||||
}
|
||||
}, [showDocumentPopover, isThreadRunning, composerRuntime, setMentionedDocuments, setMentionedDocumentIds]);
|
||||
}, [
|
||||
showDocumentPopover,
|
||||
isThreadRunning,
|
||||
composerRuntime,
|
||||
setMentionedDocuments,
|
||||
setMentionedDocumentIds,
|
||||
]);
|
||||
|
||||
// Handle document removal from inline editor
|
||||
const handleDocumentRemove = useCallback(
|
||||
|
|
|
|||
|
|
@ -69,10 +69,7 @@ function useEntranceAnimation(delay = 0): boolean {
|
|||
/**
|
||||
* Check if an extension belongs to a specific category
|
||||
*/
|
||||
function isExtensionInCategory(
|
||||
ext: string,
|
||||
category: FileExtensionCategory
|
||||
): boolean {
|
||||
function isExtensionInCategory(ext: string, category: FileExtensionCategory): boolean {
|
||||
return (FILE_EXTENSIONS[category] as readonly string[]).includes(ext);
|
||||
}
|
||||
|
||||
|
|
@ -172,8 +169,7 @@ function parseAndRenderWithBadges(text: string): React.ReactNode {
|
|||
// Chain of Thought Components
|
||||
// ============================================================================
|
||||
|
||||
export interface ChainOfThoughtItemProps
|
||||
extends React.HTMLAttributes<HTMLDivElement> {
|
||||
export interface ChainOfThoughtItemProps extends React.HTMLAttributes<HTMLDivElement> {
|
||||
children: React.ReactNode;
|
||||
}
|
||||
|
||||
|
|
@ -183,10 +179,7 @@ export const ChainOfThoughtItem: React.FC<ChainOfThoughtItemProps> = ({
|
|||
...props
|
||||
}) => (
|
||||
<div
|
||||
className={cn(
|
||||
"text-muted-foreground text-sm flex flex-wrap items-center gap-1",
|
||||
className
|
||||
)}
|
||||
className={cn("text-muted-foreground text-sm flex flex-wrap items-center gap-1", className)}
|
||||
{...props}
|
||||
>
|
||||
{typeof children === "string" ? parseAndRenderWithBadges(children) : children}
|
||||
|
|
@ -290,10 +283,7 @@ export interface ChainOfThoughtProps {
|
|||
className?: string;
|
||||
}
|
||||
|
||||
export const ChainOfThought: React.FC<ChainOfThoughtProps> = ({
|
||||
children,
|
||||
className,
|
||||
}) => {
|
||||
export const ChainOfThought: React.FC<ChainOfThoughtProps> = ({ children, className }) => {
|
||||
const childrenArray = React.Children.toArray(children);
|
||||
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -135,10 +135,7 @@ export function parseThinkingResult(data: unknown): DeepAgentThinkingResult {
|
|||
/**
|
||||
* Check if title contains any of the keywords
|
||||
*/
|
||||
function titleContainsKeywords(
|
||||
title: string,
|
||||
keywords: readonly string[]
|
||||
): boolean {
|
||||
function titleContainsKeywords(title: string, keywords: readonly string[]): boolean {
|
||||
const titleLower = title.toLowerCase();
|
||||
return keywords.some((keyword) => titleLower.includes(keyword));
|
||||
}
|
||||
|
|
@ -180,15 +177,8 @@ interface ThinkingStepDisplayProps {
|
|||
/**
|
||||
* Component to display a single thinking step with controlled open state
|
||||
*/
|
||||
const ThinkingStepDisplay: FC<ThinkingStepDisplayProps> = ({
|
||||
step,
|
||||
isOpen,
|
||||
onToggle,
|
||||
}) => {
|
||||
const icon = useMemo(
|
||||
() => getStepIcon(step.status, step.title),
|
||||
[step.status, step.title]
|
||||
);
|
||||
const ThinkingStepDisplay: FC<ThinkingStepDisplayProps> = ({ step, isOpen, onToggle }) => {
|
||||
const icon = useMemo(() => getStepIcon(step.status, step.title), [step.status, step.title]);
|
||||
|
||||
const isInProgress = step.status === STEP_STATUS.IN_PROGRESS;
|
||||
const isCompleted = step.status === STEP_STATUS.COMPLETED;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue