Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/ContentProcessorWeb/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import * as React from "react";
import { useEffect } from "react";
import Header from "./Components/Header/Header.tsx"; // Import Header
import "./Styles/App.css";
import "./Components/Content/Content.css";
import HomePage from "./Pages/HomePage.tsx";
import DefaultPage from "./Pages/DefaultPage";
//import AuxiliaryPage from "./Pages/AuxiliaryPage/AuxiliaryPage.tsx";
Expand Down
19 changes: 0 additions & 19 deletions src/ContentProcessorWeb/src/Components/Content/Content.css

This file was deleted.

52 changes: 0 additions & 52 deletions src/ContentProcessorWeb/src/Components/Content/Content.tsx

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,8 @@ import {
useId,
} from "@fluentui/react-components";

interface FooterButton {
text: string;
appearance: "primary" | "secondary";
onClick: () => void;
}
import { ConfirmationProps } from './DialogComponentTypes'

interface ConfirmationProps {
title: string;
content: string;
isDialogOpen: boolean; // Controlled state for dialog visibility
onDialogClose: () => void; // Function to close the dialog
footerButtons: FooterButton[]; // Array of footer buttons
}

export const Confirmation: React.FC<ConfirmationProps> = ({
title,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

import { ReactNode } from 'react';

interface FooterButton {
text: string;
appearance: "primary" | "secondary";
onClick: () => void;
}

export interface ConfirmationProps {
title: string;
content: string | ReactNode;
isDialogOpen: boolean; // Controlled state for dialog visibility
onDialogClose: () => void; // Function to close the dialog
footerButtons: FooterButton[]; // Array of footer buttons
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React, { useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
import { Document } from "./DocumentViewer.types";
import { TIFFViewer } from 'react-tiff';
import './DocumentViewer.styles.scss';

Expand Down Expand Up @@ -107,7 +106,7 @@ const DocumentViewer = ({ className, metadata, urlWithSasToken, iframeKey }: IIF
<div className={"invalidImagePopup"}>
<span className="imgEH">We can't open this file</span>
<p className="imgCtn">Something went wrong.</p>
</div>
</div>
: getContentComponent()
}
</div>
Expand Down

This file was deleted.

37 changes: 29 additions & 8 deletions src/ContentProcessorWeb/src/Components/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,12 @@ import {
} from "../../Imports/bundleIcons.tsx";
import MainLogo from "../../Imports/MainLogo.svg";
import "./Header.css";
import { DocumentBulletListCubeRegular, InfoRegular} from "@fluentui/react-icons"
import { DocumentBulletListCubeRegular, InfoRegular, DocumentData16Regular } from "@fluentui/react-icons"

import useAuth from "../../msal-auth/useAuth.ts";
import { useSelector, shallowEqual } from 'react-redux';
import { RootState } from '../../store/index.ts';
import useSwaggerPreview from "../../Hooks/useSwaggerPreview.ts";

interface HeaderPageProps {
toggleTheme: () => void;
Expand All @@ -41,13 +44,23 @@ const tabConfigs = [
value: "default", // Route path defined in App.tsx
label: "Content", // Visible label on UI
},

{
icon: <DocumentBulletListCubeRegular />, // Import bundle icon
value: "api", // Route path defined in App.tsx
label: "API Documentation", // Visible label on UI
},
// Add more
];

const HeaderPage: React.FC<HeaderPageProps> = ({ toggleTheme, isDarkMode }) => {
const { shortcutLabel } = useHeaderHooks({ toggleTheme, isDarkMode });
const { user, logout, getToken } = useAuth();

const { openSwaggerUI } = useSwaggerPreview();
const store = useSelector((state: RootState) => ({
swaggerJSON: state.leftPanel.swaggerJSON,
}), shallowEqual);

const navigate = useNavigate();
const location = useLocation();
Expand All @@ -69,12 +82,20 @@ const HeaderPage: React.FC<HeaderPageProps> = ({ toggleTheme, isDarkMode }) => {
_: React.SyntheticEvent,
data: { value: TabValue }
) => {
const newRoute = Object.keys(tabRoutes).find(
(key) => tabRoutes[key] === data.value
);
if (newRoute) {
navigate(newRoute);
if (data.value == 'api') {
_.preventDefault();
const apiUrl: string = process.env.REACT_APP_API_BASE_URL as string;
const token = localStorage.getItem('token') ?? undefined;
openSwaggerUI(store.swaggerJSON, apiUrl, token)
} else {
const newRoute = Object.keys(tabRoutes).find(
(key) => tabRoutes[key] === data.value
);
if (newRoute) {
navigate(newRoute);
}
}

};


Expand All @@ -100,8 +121,8 @@ const HeaderPage: React.FC<HeaderPageProps> = ({ toggleTheme, isDarkMode }) => {
</TabList>
</div>
<div className="headerTag">
<InfoRegular style={{ marginRight: "4px" }}/>
<span>AI-generated content may be incorrect</span>
<InfoRegular style={{ marginRight: "4px" }} />
<span>AI-generated content may be incorrect</span>
</div>

{/* Tools Section */}
Expand Down
Loading
Loading