feat: add file upload component with drag-and-drop support

This commit is contained in:
2026-04-09 22:52:18 -03:00
parent 11acc19e64
commit ff8df41d4b
5 changed files with 1485 additions and 8 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,14 @@
import { useIsomorphicLayoutEffect } from '@/ui/hooks/use-isomorphic-layout-effect';
import * as React from 'react';
function useAsRef<T>(props: T) {
const ref = React.useRef<T>(props);
useIsomorphicLayoutEffect(() => {
ref.current = props;
});
return ref;
}
export { useAsRef };

View File

@@ -0,0 +1,6 @@
import * as React from 'react';
const useIsomorphicLayoutEffect =
typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;
export { useIsomorphicLayoutEffect };

View File

@@ -0,0 +1,13 @@
import * as React from 'react';
function useLazyRef<T>(fn: () => T) {
const ref = React.useRef<T | null>(null);
if (ref.current === null) {
ref.current = fn();
}
return ref as React.RefObject<T>;
}
export { useLazyRef };