parent
0b43f83daa
commit
0c8bbdf02b
@ -0,0 +1,17 @@
|
||||
import { MdRefresh } from "react-icons/md";
|
||||
|
||||
export default function Revalidate() {
|
||||
const revalidate = () => {
|
||||
fetch("/api/revalidate").then((res) => {
|
||||
if (res.ok) {
|
||||
window.location.reload();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="rounded-full flex align-middle self-center mr-3">
|
||||
<MdRefresh onClick={() => revalidate()} className="text-theme-800 dark:text-theme-200 w-6 h-6 cursor-pointer" />
|
||||
</div>
|
||||
);
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
export default function UsageBar({ percent }) {
|
||||
return (
|
||||
<div className="mt-0.5 w-full bg-theme-800/30 rounded-full h-1 dark:bg-white/20">
|
||||
<div
|
||||
className="bg-theme-800/70 h-1 rounded-full dark:bg-white/50"
|
||||
style={{
|
||||
width: `${percent}%`,
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
export default async function handler(req, res) {
|
||||
try {
|
||||
await res.revalidate("/");
|
||||
return res.json({ revalidated: true });
|
||||
} catch (err) {
|
||||
return res.status(500).send("Error revalidating");
|
||||
}
|
||||
}
|
Loading…
Reference in new issue