feat: add project back buttons to project subpages

This commit is contained in:
thibaud-lclr 2026-04-16 08:42:41 +02:00
parent b7d1087e35
commit 41a953106d
3 changed files with 36 additions and 6 deletions

View file

@ -1,6 +1,6 @@
import { listen } from "@tauri-apps/api/event";
import { FormEvent, useEffect, useMemo, useState } from "react";
import { useParams } from "react-router-dom";
import { Link, useParams } from "react-router-dom";
import {
createLiveSession,
listAgents,
@ -304,7 +304,17 @@ export default function ProjectLiveAgent() {
return (
<div className="p-8 space-y-6">
<h2 className="text-xl font-bold">Live agent</h2>
<div className="flex items-center justify-between gap-3">
<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 && (
<div className="rounded border border-red-200 bg-red-50 p-2 text-sm text-red-600">

View file

@ -1,5 +1,5 @@
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 { getErrorMessage } from "../../lib/errors";
import type { ProjectModule } from "../../lib/types";
@ -43,7 +43,17 @@ export default function ProjectModules() {
return (
<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 && (
<div className="mb-4 rounded border border-red-200 bg-red-50 p-2 text-sm text-red-600">

View file

@ -1,6 +1,6 @@
import { listen } from "@tauri-apps/api/event";
import { FormEvent, useEffect, useMemo, useState } from "react";
import { useParams } from "react-router-dom";
import { Link, useParams } from "react-router-dom";
import {
cancelAgentTask,
createAgentTask,
@ -153,7 +153,17 @@ export default function ProjectTasks() {
return (
<div className="space-y-6 p-8">
<h2 className="text-xl font-bold">Tâches agent</h2>
<div className="flex items-center justify-between gap-3">
<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 && (
<div className="rounded border border-red-200 bg-red-50 p-2 text-sm text-red-600">