first commit
This commit is contained in:
commit
2d54228143
28 files changed
+8067
No files matched your search
@@ -0,0 +1,22 @@
|
||||
"use client";
|
||||
|
||||
import { refreshWeatherData } from "@/app/actions";
|
||||
import { useTransition, JSX } from "react";
|
||||
|
||||
export default function RefreshButton(): JSX.Element {
|
||||
const [isPending, startTransition] = useTransition();
|
||||
|
||||
return (
|
||||
<button
|
||||
className="btn btn-primary"
|
||||
disabled={isPending}
|
||||
onClick={() => {
|
||||
startTransition(async () => {
|
||||
await refreshWeatherData();
|
||||
});
|
||||
}}
|
||||
>
|
||||
{isPending ? "Refreshing..." : "Refresh Weather Now"}
|
||||
</button>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user