Skip to content

Enhanced ChatGPT Clone: Features Agents, MCP, Skills, DeepSeek, Anthropic, AWS, OpenAI, Responses API, Azure, Groq, o1, GPT-5, Mistral, OpenRouter, Vertex AI, Gemini, Artifacts, AI model switching, message search, Code Interpreter, langchain, DALL-E-3, OpenAPI Actions, Functions, Secure Multi-User Auth, Presets, open-source for self-hosting. Active

refactor(Slider.tsx): remove unused import and type declaration fix(Slider.tsx): fix type error in onClick event handler

Danny Avila002bba20f95f
diff --git a/client/src/components/ui/Slider.tsx b/client/src/components/ui/Slider.tsx
index 7a1f326c37..fefef62519 100644
--- a/client/src/components/ui/Slider.tsx
+++ b/client/src/components/ui/Slider.tsx
@@ -1,12 +1,9 @@
-'use client';
-
import * as React from 'react';
import * as SliderPrimitive from '@radix-ui/react-slider';
import { useDoubleClick } from '@zattoo/use-double-click';
+import type { clickEvent } from '@zattoo/use-double-click';
import { cn } from '../../utils';
-type clickEvent = (event: React.MouseEvent<HTMLButtonElement>) => void;
-
interface SliderProps extends React.ComponentPropsWithoutRef<typeof SliderPrimitive.Root> {
doubleClickHandler?: clickEvent;
}
@@ -23,7 +20,7 @@ const Slider = React.forwardRef<React.ElementRef<typeof SliderPrimitive.Root>, S
</SliderPrimitive.Track>
<SliderPrimitive.Thumb
onClick={
- useDoubleClick(doubleClickHandler) ??
+ useDoubleClick(doubleClickHandler as clickEvent) ??
(() => {
return;
})