"use client"; import { RefreshCcwIcon } from "lucide-react"; import { useTransition } from "react"; import { CustomButton } from "../ui/custom"; export const ButtonRefreshData = ({ onPress, }: { onPress: () => Promise; }) => { const [isPending, startTransition] = useTransition(); return ( } isLoading={isPending} onPress={() => { startTransition(async () => { await onPress(); }); }} /> ); };