feat(ai): move the assistant to its own "Odin" sidebar page

Promote the AI chat from a dashboard widget to a dedicated page:
- new sidebar item "Odin" under the Přehled section, gated on ai.use, → /odin
- new /odin route + Odin page (reuses the assistant component, with a light
  ai.use guard)
- remove the widget from the dashboard
- rebrand the assistant header "Asistent" → "Odin" and give the thread more
  height now that it owns the page

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
BOHA
2026-06-08 18:38:35 +02:00
parent 049ee492c0
commit e4ec08a5ef
5 changed files with 48 additions and 7 deletions

View File

@@ -22,7 +22,6 @@ import DashSessions from "../components/dashboard/DashSessions";
import DashTodayPlan, {
type TodayPlan,
} from "../components/dashboard/DashTodayPlan";
import DashAssistant from "../components/dashboard/DashAssistant";
const API_BASE = "/api/admin";
@@ -237,9 +236,6 @@ export default function Dashboard() {
</Typography>
</Box>
{/* AI Assistant widget */}
{hasPermission("ai.use") && <DashAssistant />}
{/* 2FA Required Banner */}
{user?.require2FA && !user?.totpEnabled && (
<Card

27
src/admin/pages/Odin.tsx Normal file
View File

@@ -0,0 +1,27 @@
import Box from "@mui/material/Box";
import Typography from "@mui/material/Typography";
import { PageEnter } from "../ui";
import { useAuth } from "../context/AuthContext";
import DashAssistant from "../components/dashboard/DashAssistant";
export default function Odin() {
const { hasPermission } = useAuth();
if (!hasPermission("ai.use")) {
return (
<PageEnter>
<Typography variant="body1" color="text.secondary">
Nemáte oprávnění pro AI asistenta.
</Typography>
</PageEnter>
);
}
return (
<PageEnter>
<Box sx={{ maxWidth: 920, mx: "auto" }}>
<DashAssistant />
</Box>
</PageEnter>
);
}