diff options
| author | Maze Winther <mazewinther@gmail.com> | 2026-04-18 15:35:04 +0200 |
|---|---|---|
| committer | Maze Winther <mazewinther@gmail.com> | 2026-04-18 15:35:04 +0200 |
| commit | 0387bd4c80f699cf0272fa0165d3c86dceaf39dc (patch) | |
| tree | 7c72abb6dde074b16ebf84b1d2c72a3bd58b3fff /legacy/use-reveal-item.ts | |
| parent | b1d0b103549b7b707c8b90e8a5cb98235dc385c9 (diff) | |
| download | opencut-0387bd4c80f699cf0272fa0165d3c86dceaf39dc.tar.gz | |
delete legacy folder
Diffstat (limited to 'legacy/use-reveal-item.ts')
| -rw-r--r-- | legacy/use-reveal-item.ts | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/legacy/use-reveal-item.ts b/legacy/use-reveal-item.ts deleted file mode 100644 index dd13d844..00000000 --- a/legacy/use-reveal-item.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { useEffect, useState } from "react";
-
-export function useRevealItem(
- highlightId: string | null,
- onClearHighlight: () => void,
- getElement: (id: string) => HTMLElement | null,
- highlightDuration = 1000,
-) {
- const [highlightedId, setHighlightedId] = useState<string | null>(null);
-
- useEffect(() => {
- if (!highlightId) return;
-
- setHighlightedId(highlightId);
-
- const target = getElement(highlightId);
- target?.scrollIntoView({ block: "center" });
-
- const timeout = setTimeout(() => {
- setHighlightedId(null);
- onClearHighlight();
- }, highlightDuration);
-
- return () => clearTimeout(timeout);
- }, [highlightId, onClearHighlight, highlightDuration, getElement]);
-
- return { highlightedId };
-}
|
