diff --git a/src/app/r/[slug]/not-found.tsx b/src/app/r/[slug]/not-found.tsx index df8c471..5fca86a 100644 --- a/src/app/r/[slug]/not-found.tsx +++ b/src/app/r/[slug]/not-found.tsx @@ -9,7 +9,7 @@ export default function NotFound() { Link Not Found
- The link you're looking for doesn't exist or has expired. + The link you're looking for doesn't exist or has expired.
({}) const router = useRouter() - function handleCopy(string: string) { + const handleCopy = React.useCallback((string: string) => { navigator.clipboard.writeText(string).then(() => { toast.success("URL copied to clipboard") }).catch(() => { toast.error("Failed to copy URL") }) - } + }, []) - async function handleDelete(id: string) { + const handleDelete = React.useCallback(async (id: string) => { const res = await deleteUrl(id) if (res.error) { @@ -255,49 +255,51 @@ export function UrlsDataTable({ data }: UrlsDataTableProps) { toast.success("URL deleted successfully") router.refresh() } - } + }, [router]) - const actionRow: ColumnDef