/********************************************************************************
* 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 { SearchToolbar, CountsToolbar } from '../toolbars';
import { FileTable, AutoRefresh } from '../common';
import { useBlockListTab } from '../../../hooks/scan-admin';
import { useScanContext } from '../../../context/scan-admin';
import { useTheme } from '@mui/material/styles';
/**
* Blocked Files tab component that displays files that have been blocked.
* Uses the useBlockListTab hook to consume context.
*/
export const BlockListTabContent: FunctionComponent = () => {
const theme = useTheme();
const { state, actions } = useScanContext();
const {
files,
isLoading,
fileCount,
search,
selection,
setFilesChecked,
fileActions,
pagination,
lastRefreshed,
autoRefresh,
onAutoRefreshChange,
} = useBlockListTab();
return (
<>
{isLoading ? (
) : files.length === 0 ? (
No blocked files
Files that have been blocked will appear here
) : (
)}
{pagination.totalPages > 1 && (
pagination.goToPage(page - 1)}
disabled={isLoading}
color='secondary'
size='large'
showFirstButton
showLastButton
/>
)}
>
);
};