/********************************************************************************
* 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 type { SyntheticEvent } from "react";
import { FunctionComponent, useContext } from 'react';
import { Box, Typography } from '@mui/material';
import { ScanProvider } from '../../context/scan-admin';
import { useTabNavigation, useUrlSync } from '../../hooks/scan-admin';
import {
TabToolbar,
TabPanel,
ScansTabContent,
QuarantinedTabContent,
AutoRejectedTabContent,
AllowListTabContent,
BlockListTabContent,
QuarantineDialog,
FileDialog,
} from '../../components/scan-admin';
import { MainContext } from '../../context';
/**
* Inner component that consumes the ScanContext.
* Uses lean tab components that consume context via hooks.
*/
const ScanAdminContent: FunctionComponent = () => {
const { selectedTab, setTab } = useTabNavigation();
// Sync state with URL parameters for bookmarkable URLs and browser navigation
useUrlSync();
const handleTabChange = (_event: SyntheticEvent, newValue: number) => {
setTab(newValue);
};
return (
Extension Scans
{/* Tab panels - each tab content component consumes context via hooks */}
{/* Dialogs - consume context via hooks */}
);
};
/**
* Main ScanAdmin component that provides the context.
* This is the entry point for the scan administration feature.
*/
export const ScanAdmin: FunctionComponent = () => {
const { service, handleError } = useContext(MainContext);
return (
);
};
export default ScanAdmin;