17 lines
345 B
TypeScript
17 lines
345 B
TypeScript
"use client";
|
|
import { useInView } from "react-intersection-observer";
|
|
import { Icon } from "../general/Icon";
|
|
|
|
export const ToTop = () => {
|
|
const scrollToTop = () => {
|
|
window.scrollTo({
|
|
top: 0,
|
|
behavior: "smooth",
|
|
});
|
|
};
|
|
return <button onClick={scrollToTop}>
|
|
Til toppen
|
|
<Icon type="arrowUp" />
|
|
</button>;
|
|
};
|