mirror of
https://github.com/rjNemo/ticket_manager
synced 2026-06-06 00:36:39 +00:00
38 lines
922 B
TypeScript
38 lines
922 B
TypeScript
import React, { FC } from "react";
|
|
import { TabRouterHeader } from "./TabRouterHeader";
|
|
import { TicketList } from "./TicketList";
|
|
|
|
import { Ticket } from "../types/Ticket";
|
|
|
|
import { Route, useRouteMatch, Redirect } from "react-router-dom";
|
|
|
|
import { Project } from "../types/Project";
|
|
import { ProjectList } from "./ProjectList";
|
|
|
|
interface IProps {
|
|
tabNames: string[];
|
|
tickets: Ticket[];
|
|
projects: Project[];
|
|
}
|
|
|
|
export const UserTabRouter: FC<IProps> = ({ tickets, tabNames, projects }) => {
|
|
const { url } = useRouteMatch();
|
|
|
|
return (
|
|
<>
|
|
<div className="row">
|
|
<TabRouterHeader tabNames={tabNames} />
|
|
|
|
<Redirect from={url} to={`${url}/projects`} />
|
|
|
|
<Route path={`${url}/projects`}>
|
|
<ProjectList projects={projects} />
|
|
</Route>
|
|
|
|
<Route path={`${url}/tickets`}>
|
|
<TicketList tickets={tickets} />
|
|
</Route>
|
|
</div>
|
|
</>
|
|
);
|
|
};
|