mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-07 21:27:31 +00:00
misc: added loader
This commit is contained in:
@@ -3,7 +3,7 @@ import { zodResolver } from "@hookform/resolvers/zod";
|
|||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
|
|
||||||
import { createNotification } from "@app/components/notifications";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import { Button, FormControl, Input } from "@app/components/v2";
|
import { Button, ContentLoader, FormControl, Input } from "@app/components/v2";
|
||||||
import { useGetRateLimit, useUpdateRateLimit } from "@app/hooks/api";
|
import { useGetRateLimit, useUpdateRateLimit } from "@app/hooks/api";
|
||||||
|
|
||||||
const formSchema = z.object({
|
const formSchema = z.object({
|
||||||
@@ -20,7 +20,7 @@ const formSchema = z.object({
|
|||||||
type TRateLimitForm = z.infer<typeof formSchema>;
|
type TRateLimitForm = z.infer<typeof formSchema>;
|
||||||
|
|
||||||
export const RateLimitPanel = () => {
|
export const RateLimitPanel = () => {
|
||||||
const { data: rateLimit } = useGetRateLimit();
|
const { data: rateLimit, isLoading } = useGetRateLimit();
|
||||||
const { mutateAsync: updateRateLimit } = useUpdateRateLimit();
|
const { mutateAsync: updateRateLimit } = useUpdateRateLimit();
|
||||||
|
|
||||||
const {
|
const {
|
||||||
@@ -78,7 +78,9 @@ export const RateLimitPanel = () => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return isLoading ? (
|
||||||
|
<ContentLoader />
|
||||||
|
) : (
|
||||||
<form
|
<form
|
||||||
className="mb-6 rounded-lg border border-mineshaft-600 bg-mineshaft-900 p-4"
|
className="mb-6 rounded-lg border border-mineshaft-600 bg-mineshaft-900 p-4"
|
||||||
onSubmit={handleSubmit(onRateLimitFormSubmit)}
|
onSubmit={handleSubmit(onRateLimitFormSubmit)}
|
||||||
|
|||||||
Reference in New Issue
Block a user