import Typography from "@mui/material/Typography";
import { PageEnter } from "../ui";
import { useAuth } from "../context/AuthContext";
import OdinChat from "../components/odin/OdinChat";

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>
      <OdinChat />
    </PageEnter>
  );
}
