/********************************************************************************
* Copyright (c) 2026 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* https://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
********************************************************************************/
import { FunctionComponent } from 'react';
import { Box, Typography, Pagination, CircularProgress } from '@mui/material';
import { ScanCard } from '../scan-card';
import { SearchToolbar, CountsToolbar } from '../toolbars';
import { AutoRefresh } from '../common';
import { useAutoRejectedTab } from '../../../hooks/scan-admin';
/**
* Auto Rejected tab component that displays extensions that failed validation.
* Uses the useAutoRejectedTab hook to consume context.
*/
export const AutoRejectedTabContent: FunctionComponent = () => {
const {
scans,
isLoading,
lastRefreshed,
autoRefresh,
onAutoRefreshChange,
totalCount,
search,
globalFilters,
validationTypeFilters,
pagination,
hasValidationTypes,
} = useAutoRejectedTab();
return (
<>
({
label: type,
value: type,
checked: validationTypeFilters.filters.has(type),
}))}
onFilterOptionToggle={validationTypeFilters.toggle}
dateRange={globalFilters.dateRange}
onDateRangeChange={globalFilters.setDateRange}
enforcement={globalFilters.enforcement}
onEnforcementChange={globalFilters.setEnforcement}
/>
{isLoading ? (
) : (!hasValidationTypes || scans.length === 0) ? (
No auto rejected extensions
Extensions that fail validation will appear here
) : (
scans.map((scan) => (
))
)}
{pagination.totalPages > 1 && (
pagination.goToPage(page - 1)}
disabled={isLoading}
color='secondary'
size='large'
showFirstButton
showLastButton
/>
)}
>
);
};