mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-07-23 12:31:54 +00:00
chore: replace disable for isDisable prop
This commit is contained in:
@@ -34,10 +34,10 @@ export default async function Scans({
|
||||
<div className="grid grid-cols-12 items-start gap-4">
|
||||
<div className="col-span-12 lg:col-span-4">
|
||||
<Suspense key={searchParamsKey} fallback={<SkeletonTableScans />}>
|
||||
<SSRDataTableProviders searchParams={searchParams} />
|
||||
<SSRDataTableProviders />
|
||||
</Suspense>
|
||||
</div>
|
||||
<div className="col-span-12 lg:col-span-8">
|
||||
<div className="col-span-12 lg:col-span-6">
|
||||
<Suspense key={searchParamsKey} fallback={<SkeletonTableScans />}>
|
||||
<SSRDataTableScansSchedule searchParams={searchParams} />
|
||||
</Suspense>
|
||||
@@ -52,23 +52,19 @@ export default async function Scans({
|
||||
);
|
||||
}
|
||||
|
||||
const SSRDataTableProviders = async ({
|
||||
searchParams,
|
||||
}: {
|
||||
searchParams: SearchParamsProps;
|
||||
}) => {
|
||||
const page = parseInt(searchParams.page?.toString() || "1", 10);
|
||||
const sort = searchParams.sort?.toString();
|
||||
const SSRDataTableProviders = async () => {
|
||||
// const page = parseInt(searchParams.page?.toString() || "1", 10);
|
||||
// const sort = searchParams.sort?.toString();
|
||||
|
||||
// Extract all filter parameters
|
||||
const filters = Object.fromEntries(
|
||||
Object.entries(searchParams).filter(([key]) => key.startsWith("filter[")),
|
||||
);
|
||||
// const filters = Object.fromEntries(
|
||||
// Object.entries(searchParams).filter(([key]) => key.startsWith("filter[")),
|
||||
// );
|
||||
|
||||
// Extract query from filters
|
||||
const query = (filters["filter[search]"] as string) || "";
|
||||
// const query = (filters["filter[search]"] as string) || "";
|
||||
|
||||
const providersData = await getProviders({ query, page, sort, filters });
|
||||
const providersData = await getProviders({ page: 1 });
|
||||
|
||||
return (
|
||||
<DataTable
|
||||
|
||||
@@ -234,7 +234,7 @@ export const AuthForm = ({ type }: { type: string }) => {
|
||||
size="md"
|
||||
radius="md"
|
||||
isLoading={isLoading}
|
||||
disabled={isLoading}
|
||||
isDisabled={isLoading}
|
||||
>
|
||||
{isLoading ? (
|
||||
<span>Loading</span>
|
||||
|
||||
@@ -103,7 +103,7 @@ export const AddForm = ({
|
||||
size="lg"
|
||||
radius="lg"
|
||||
onPress={() => setIsOpen(false)}
|
||||
disabled={isLoading}
|
||||
isDisabled={isLoading}
|
||||
>
|
||||
<span>Cancel</span>
|
||||
</CustomButton>
|
||||
|
||||
@@ -63,7 +63,7 @@ export const DeleteForm = ({
|
||||
size="lg"
|
||||
radius="lg"
|
||||
onPress={() => setIsOpen(false)}
|
||||
disabled={isLoading}
|
||||
isDisabled={isLoading}
|
||||
>
|
||||
<span>Cancel</span>
|
||||
</CustomButton>
|
||||
|
||||
@@ -95,7 +95,7 @@ export const EditForm = ({
|
||||
size="lg"
|
||||
radius="lg"
|
||||
onPress={() => setIsOpen(false)}
|
||||
disabled={isLoading}
|
||||
isDisabled={isLoading}
|
||||
>
|
||||
<span>Cancel</span>
|
||||
</CustomButton>
|
||||
|
||||
@@ -95,7 +95,7 @@ export const EditScanForm = ({
|
||||
size="lg"
|
||||
radius="lg"
|
||||
onPress={() => setIsOpen(false)}
|
||||
disabled={isLoading}
|
||||
isDisabled={isLoading}
|
||||
>
|
||||
<span>Cancel</span>
|
||||
</CustomButton>
|
||||
|
||||
@@ -102,14 +102,14 @@ export const ScanOnDemandForm = ({
|
||||
size="lg"
|
||||
radius="lg"
|
||||
onPress={() => setIsOpen(false)}
|
||||
disabled={isLoading}
|
||||
isDisabled={isLoading}
|
||||
>
|
||||
<span>Cancel</span>
|
||||
</CustomButton>
|
||||
|
||||
<CustomButton
|
||||
type="submit"
|
||||
ariaLabel="Save"
|
||||
ariaLabel="Start scan now"
|
||||
className="w-full"
|
||||
variant="solid"
|
||||
color="action"
|
||||
|
||||
@@ -88,7 +88,7 @@ export const ScheduleForm = ({
|
||||
size="lg"
|
||||
radius="lg"
|
||||
onPress={() => setIsOpen(false)}
|
||||
disabled={isLoading}
|
||||
isDisabled={isLoading}
|
||||
>
|
||||
<span>Cancel</span>
|
||||
</CustomButton>
|
||||
@@ -102,6 +102,7 @@ export const ScheduleForm = ({
|
||||
size="lg"
|
||||
isLoading={isLoading}
|
||||
startContent={!isLoading && <SaveIcon size={24} />}
|
||||
isDisabled={true}
|
||||
>
|
||||
{isLoading ? <>Loading</> : <span>Schedule</span>}
|
||||
</CustomButton>
|
||||
|
||||
@@ -46,7 +46,7 @@ interface CustomButtonProps {
|
||||
size?: "sm" | "md" | "lg";
|
||||
radius?: "none" | "sm" | "md" | "lg" | "full";
|
||||
dashed?: boolean;
|
||||
disabled?: boolean;
|
||||
isDisabled?: boolean;
|
||||
isLoading?: boolean;
|
||||
isIconOnly?: boolean;
|
||||
ref?: React.RefObject<HTMLButtonElement>;
|
||||
@@ -70,7 +70,7 @@ export const CustomButton = React.forwardRef<
|
||||
endContent,
|
||||
size = "md",
|
||||
radius = "sm",
|
||||
disabled = false,
|
||||
isDisabled = false,
|
||||
isLoading = false,
|
||||
isIconOnly,
|
||||
...props
|
||||
@@ -92,8 +92,8 @@ export const CustomButton = React.forwardRef<
|
||||
[buttonClasses.action]: color === "action",
|
||||
[buttonClasses.dashed]: variant === "dashed",
|
||||
[buttonClasses.transparent]: color === "transparent",
|
||||
[buttonClasses.disabled]: disabled,
|
||||
[buttonClasses.hover]: color !== "transparent" && !disabled,
|
||||
[buttonClasses.disabled]: isDisabled,
|
||||
[buttonClasses.hover]: color !== "transparent" && !isDisabled,
|
||||
},
|
||||
className,
|
||||
)}
|
||||
@@ -112,6 +112,7 @@ export const CustomButton = React.forwardRef<
|
||||
/>
|
||||
}
|
||||
ref={ref}
|
||||
isDisabled={isDisabled}
|
||||
isLoading={isLoading}
|
||||
isIconOnly={isIconOnly}
|
||||
{...props}
|
||||
|
||||
Reference in New Issue
Block a user