Initial commit
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
"use client";
|
||||
import { useEffect } from "react";
|
||||
import { usePathname } from "next/navigation";
|
||||
import { useSelection } from "./SelectionProvider";
|
||||
|
||||
export function RegisterVisible({ ids }: { ids: number[] }) {
|
||||
const pathname = usePathname();
|
||||
const { clear, setVisibleIds } = useSelection();
|
||||
|
||||
useEffect(() => {
|
||||
setVisibleIds(ids);
|
||||
return () => setVisibleIds([]);
|
||||
}, [ids, setVisibleIds]);
|
||||
|
||||
useEffect(() => {
|
||||
return () => clear();
|
||||
}, [pathname, clear]);
|
||||
|
||||
return null;
|
||||
}
|
||||
Reference in New Issue
Block a user