feat: add project back buttons to project subpages
This commit is contained in:
parent
b7d1087e35
commit
41a953106d
3 changed files with 36 additions and 6 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
import { listen } from "@tauri-apps/api/event";
|
import { listen } from "@tauri-apps/api/event";
|
||||||
import { FormEvent, useEffect, useMemo, useState } from "react";
|
import { FormEvent, useEffect, useMemo, useState } from "react";
|
||||||
import { useParams } from "react-router-dom";
|
import { Link, useParams } from "react-router-dom";
|
||||||
import {
|
import {
|
||||||
createLiveSession,
|
createLiveSession,
|
||||||
listAgents,
|
listAgents,
|
||||||
|
|
@ -304,7 +304,17 @@ export default function ProjectLiveAgent() {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="p-8 space-y-6">
|
<div className="p-8 space-y-6">
|
||||||
|
<div className="flex items-center justify-between gap-3">
|
||||||
<h2 className="text-xl font-bold">Live agent</h2>
|
<h2 className="text-xl font-bold">Live agent</h2>
|
||||||
|
{projectId && (
|
||||||
|
<Link
|
||||||
|
to={`/projects/${projectId}`}
|
||||||
|
className="rounded bg-gray-200 px-4 py-2 text-sm text-gray-700 hover:bg-gray-300"
|
||||||
|
>
|
||||||
|
Retour
|
||||||
|
</Link>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
|
||||||
{error && (
|
{error && (
|
||||||
<div className="rounded border border-red-200 bg-red-50 p-2 text-sm text-red-600">
|
<div className="rounded border border-red-200 bg-red-50 p-2 text-sm text-red-600">
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useParams } from "react-router-dom";
|
import { Link, useParams } from "react-router-dom";
|
||||||
import { listProjectModules, setProjectModuleEnabled } from "../../lib/api";
|
import { listProjectModules, setProjectModuleEnabled } from "../../lib/api";
|
||||||
import { getErrorMessage } from "../../lib/errors";
|
import { getErrorMessage } from "../../lib/errors";
|
||||||
import type { ProjectModule } from "../../lib/types";
|
import type { ProjectModule } from "../../lib/types";
|
||||||
|
|
@ -43,7 +43,17 @@ export default function ProjectModules() {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="p-8">
|
<div className="p-8">
|
||||||
<h2 className="mb-6 text-xl font-bold">Modules du projet</h2>
|
<div className="mb-6 flex items-center justify-between gap-3">
|
||||||
|
<h2 className="text-xl font-bold">Modules du projet</h2>
|
||||||
|
{projectId && (
|
||||||
|
<Link
|
||||||
|
to={`/projects/${projectId}`}
|
||||||
|
className="rounded bg-gray-200 px-4 py-2 text-sm text-gray-700 hover:bg-gray-300"
|
||||||
|
>
|
||||||
|
Retour
|
||||||
|
</Link>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
|
||||||
{error && (
|
{error && (
|
||||||
<div className="mb-4 rounded border border-red-200 bg-red-50 p-2 text-sm text-red-600">
|
<div className="mb-4 rounded border border-red-200 bg-red-50 p-2 text-sm text-red-600">
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import { listen } from "@tauri-apps/api/event";
|
import { listen } from "@tauri-apps/api/event";
|
||||||
import { FormEvent, useEffect, useMemo, useState } from "react";
|
import { FormEvent, useEffect, useMemo, useState } from "react";
|
||||||
import { useParams } from "react-router-dom";
|
import { Link, useParams } from "react-router-dom";
|
||||||
import {
|
import {
|
||||||
cancelAgentTask,
|
cancelAgentTask,
|
||||||
createAgentTask,
|
createAgentTask,
|
||||||
|
|
@ -153,7 +153,17 @@ export default function ProjectTasks() {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="space-y-6 p-8">
|
<div className="space-y-6 p-8">
|
||||||
|
<div className="flex items-center justify-between gap-3">
|
||||||
<h2 className="text-xl font-bold">Tâches agent</h2>
|
<h2 className="text-xl font-bold">Tâches agent</h2>
|
||||||
|
{projectId && (
|
||||||
|
<Link
|
||||||
|
to={`/projects/${projectId}`}
|
||||||
|
className="rounded bg-gray-200 px-4 py-2 text-sm text-gray-700 hover:bg-gray-300"
|
||||||
|
>
|
||||||
|
Retour
|
||||||
|
</Link>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
|
||||||
{error && (
|
{error && (
|
||||||
<div className="rounded border border-red-200 bg-red-50 p-2 text-sm text-red-600">
|
<div className="rounded border border-red-200 bg-red-50 p-2 text-sm text-red-600">
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue