mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-26 09:16:22 +02:00
Replace setOpen(!open) toggles with functional setOpen(prev => !prev) across codebase
This commit is contained in:
parent
1705e881ec
commit
4e6251ea04
9 changed files with 9 additions and 9 deletions
|
|
@ -243,7 +243,7 @@ export const MCPConnectForm: FC<ConnectFormProps> = ({ onSubmit, isSubmitting })
|
||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
setShowDetails(!showDetails);
|
setShowDetails(prev => !prev);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{showDetails ? (
|
{showDetails ? (
|
||||||
|
|
|
||||||
|
|
@ -250,7 +250,7 @@ export const ComposioDriveConfig: FC<ConnectorConfigProps> = ({ connector, onCon
|
||||||
<div className="space-y-2">
|
<div className="space-y-2">
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
onClick={() => setIsFolderTreeOpen(!isFolderTreeOpen)}
|
onClick={() => setIsFolderTreeOpen(prev => !prev)}
|
||||||
className="flex items-center gap-2 text-xs sm:text-sm text-muted-foreground hover:text-foreground transition-colors w-fit"
|
className="flex items-center gap-2 text-xs sm:text-sm text-muted-foreground hover:text-foreground transition-colors w-fit"
|
||||||
>
|
>
|
||||||
Change Selection
|
Change Selection
|
||||||
|
|
|
||||||
|
|
@ -248,7 +248,7 @@ export const MCPConfig: FC<MCPConfigProps> = ({ connector, onConfigChange, onNam
|
||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
setShowDetails(!showDetails);
|
setShowDetails(prev => !prev);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{showDetails ? (
|
{showDetails ? (
|
||||||
|
|
|
||||||
|
|
@ -221,7 +221,7 @@ export const OneDriveConfig: FC<ConnectorConfigProps> = ({ connector, onConfigCh
|
||||||
<div className="space-y-2">
|
<div className="space-y-2">
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
onClick={() => setIsFolderTreeOpen(!isFolderTreeOpen)}
|
onClick={() => setIsFolderTreeOpen(prev => !prev)}
|
||||||
className="flex items-center gap-2 text-xs sm:text-sm text-muted-foreground hover:text-foreground transition-colors w-fit"
|
className="flex items-center gap-2 text-xs sm:text-sm text-muted-foreground hover:text-foreground transition-colors w-fit"
|
||||||
>
|
>
|
||||||
Change Selection
|
Change Selection
|
||||||
|
|
|
||||||
|
|
@ -86,7 +86,7 @@ export const WebcrawlerConfig: FC<ConnectorConfigProps> = ({ connector, onConfig
|
||||||
type="button"
|
type="button"
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
size="sm"
|
size="sm"
|
||||||
onClick={() => setShowApiKey(!showApiKey)}
|
onClick={() => setShowApiKey(prev => !prev)}
|
||||||
className="absolute right-1 top-1/2 -translate-y-1/2 h-7 px-2 text-xs text-muted-foreground hover:text-foreground"
|
className="absolute right-1 top-1/2 -translate-y-1/2 h-7 px-2 text-xs text-muted-foreground hover:text-foreground"
|
||||||
>
|
>
|
||||||
{showApiKey ? "Hide" : "Show"}
|
{showApiKey ? "Hide" : "Show"}
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,7 @@ export const ThinkingStepsDisplay: FC<{ steps: ThinkingStep[]; isThreadRunning?:
|
||||||
<div className="rounded-lg">
|
<div className="rounded-lg">
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
onClick={() => setIsOpen(!isOpen)}
|
onClick={() => setIsOpen(prev => !prev)}
|
||||||
className={cn(
|
className={cn(
|
||||||
"flex w-full items-center gap-1.5 text-left text-sm transition-colors",
|
"flex w-full items-center gap-1.5 text-left text-sm transition-colors",
|
||||||
"text-muted-foreground hover:text-foreground"
|
"text-muted-foreground hover:text-foreground"
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ export const ToolFallback: ToolCallMessagePartComponent = ({
|
||||||
>
|
>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
onClick={() => setIsExpanded(!isExpanded)}
|
onClick={() => setIsExpanded(prev => !prev)}
|
||||||
className="flex w-full items-center gap-3 px-5 py-4 text-left transition-colors hover:bg-muted/50 focus:outline-none focus-visible:outline-none"
|
className="flex w-full items-center gap-3 px-5 py-4 text-left transition-colors hover:bg-muted/50 focus:outline-none focus-visible:outline-none"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
|
|
|
||||||
|
|
@ -93,7 +93,7 @@ export function CommentThread({
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
size="sm"
|
size="sm"
|
||||||
className="h-6 px-2 text-xs text-muted-foreground hover:text-foreground"
|
className="h-6 px-2 text-xs text-muted-foreground hover:text-foreground"
|
||||||
onClick={() => setIsRepliesExpanded(!isRepliesExpanded)}
|
onClick={() => setIsRepliesExpanded(prev => !prev)}
|
||||||
>
|
>
|
||||||
{isRepliesExpanded ? (
|
{isRepliesExpanded ? (
|
||||||
<ChevronDown className="mr-1 size-3" />
|
<ChevronDown className="mr-1 size-3" />
|
||||||
|
|
|
||||||
|
|
@ -162,7 +162,7 @@ const MobileNav = ({ navItems, isScrolled, scrolledBgClassName }: any) => {
|
||||||
</Link>
|
</Link>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
onClick={() => setOpen(!open)}
|
onClick={() => setOpen(prev => !prev)}
|
||||||
className="relative z-50 flex items-center justify-center p-2 -mr-2 rounded-lg hover:bg-gray-100 dark:hover:bg-neutral-800 transition-colors touch-manipulation"
|
className="relative z-50 flex items-center justify-center p-2 -mr-2 rounded-lg hover:bg-gray-100 dark:hover:bg-neutral-800 transition-colors touch-manipulation"
|
||||||
aria-label={open ? "Close menu" : "Open menu"}
|
aria-label={open ? "Close menu" : "Open menu"}
|
||||||
>
|
>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue