Add useCallbackRef hook and update imports
Implemented a custom `useCallbackRef` hook to optimize callback refs. Updated import paths for consistency and replaced `Cross2Icon` with `CrossIcon` in FileUploader component.
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
import Dropzone, { DropzoneProps, FileRejection } from 'react-dropzone';
|
||||
import { toast } from 'sonner';
|
||||
import React from 'react';
|
||||
import { FileTextIcon, UploadIcon } from 'lucide-react';
|
||||
import { CrossIcon, FileTextIcon, UploadIcon } from 'lucide-react';
|
||||
import { ScrollArea } from './ui/scroll-area';
|
||||
import { Progress } from '@radix-ui/react-progress';
|
||||
import { Button } from './ui/button';
|
||||
import { formatBytes } from '../lib/utils';
|
||||
import { cn, formatBytes } from '../lib/utils';
|
||||
import { useControllableState } from '../hooks/use-controllable-state';
|
||||
import Image from 'next/image';
|
||||
|
||||
|
||||
interface FileUploaderProps extends React.HTMLAttributes<HTMLDivElement> {
|
||||
@@ -288,7 +290,7 @@ function FileCard({ file, progress, onRemove }: FileCardProps) {
|
||||
className="size-7"
|
||||
onClick={onRemove}
|
||||
>
|
||||
<Cross2Icon className="size-4" aria-hidden="true" />
|
||||
<CrossIcon className="size-4" aria-hidden="true" />
|
||||
<span className="sr-only">Remove file</span>
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import * as React from "react"
|
||||
import * as AvatarPrimitive from "@radix-ui/react-avatar"
|
||||
|
||||
import { cn } from "@/lib/utils"
|
||||
import { cn } from "../../lib/utils"
|
||||
|
||||
const Avatar = React.forwardRef<
|
||||
React.ElementRef<typeof AvatarPrimitive.Root>,
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import * as React from "react"
|
||||
import { Drawer as DrawerPrimitive } from "vaul"
|
||||
|
||||
import { cn } from "@/lib/utils"
|
||||
import { cn } from "../../lib/utils"
|
||||
|
||||
const Drawer = ({
|
||||
shouldScaleBackground = true,
|
||||
|
||||
@@ -4,7 +4,7 @@ import * as React from "react"
|
||||
import * as SelectPrimitive from "@radix-ui/react-select"
|
||||
import { Check, ChevronDown, ChevronUp } from "lucide-react"
|
||||
|
||||
import { cn } from "@/lib/utils"
|
||||
import { cn } from "../../lib/utils"
|
||||
|
||||
const Select = SelectPrimitive.Root
|
||||
|
||||
|
||||
Reference in New Issue
Block a user