mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 17:00:15 +01:00
refactor(Slider.tsx): remove unused import and type declaration
fix(Slider.tsx): fix type error in onClick event handler
This commit is contained in:
parent
b896225bd8
commit
002bba20f9
1 changed files with 2 additions and 5 deletions
|
|
@ -1,12 +1,9 @@
|
||||||
'use client';
|
|
||||||
|
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import * as SliderPrimitive from '@radix-ui/react-slider';
|
import * as SliderPrimitive from '@radix-ui/react-slider';
|
||||||
import { useDoubleClick } from '@zattoo/use-double-click';
|
import { useDoubleClick } from '@zattoo/use-double-click';
|
||||||
|
import type { clickEvent } from '@zattoo/use-double-click';
|
||||||
import { cn } from '../../utils';
|
import { cn } from '../../utils';
|
||||||
|
|
||||||
type clickEvent = (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
||||||
|
|
||||||
interface SliderProps extends React.ComponentPropsWithoutRef<typeof SliderPrimitive.Root> {
|
interface SliderProps extends React.ComponentPropsWithoutRef<typeof SliderPrimitive.Root> {
|
||||||
doubleClickHandler?: clickEvent;
|
doubleClickHandler?: clickEvent;
|
||||||
}
|
}
|
||||||
|
|
@ -23,7 +20,7 @@ const Slider = React.forwardRef<React.ElementRef<typeof SliderPrimitive.Root>, S
|
||||||
</SliderPrimitive.Track>
|
</SliderPrimitive.Track>
|
||||||
<SliderPrimitive.Thumb
|
<SliderPrimitive.Thumb
|
||||||
onClick={
|
onClick={
|
||||||
useDoubleClick(doubleClickHandler) ??
|
useDoubleClick(doubleClickHandler as clickEvent) ??
|
||||||
(() => {
|
(() => {
|
||||||
return;
|
return;
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue