fix: TypeScript build errors

This commit is contained in:
Alexej Wolff
2026-02-11 00:26:34 +01:00
parent cc003ffbd5
commit a9f0ab225b
5 changed files with 4 additions and 12 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
import { useState, useEffect } from "react";
import { Link, useNavigate } from "react-router-dom";
import { useNavigate } from "react-router-dom";
import { useAuth } from "../contexts/AuthContext";
import {
getPlayerCharacters,
-7
View File
@@ -2,7 +2,6 @@ import { useState, useEffect, useRef } from "react";
import {
useParams,
Link,
useNavigate,
useSearchParams,
} from "react-router-dom";
import ReactMarkdown from "react-markdown";
@@ -103,7 +102,6 @@ function detectLocation(messages: ChatMessage[]): string {
export default function GamePage() {
const { id } = useParams<{ id: string }>();
const [searchParams] = useSearchParams();
const navigate = useNavigate();
const { isAuthenticated } = useAuth();
const [story, setStory] = useState<Story | null>(null);
const [session, setSession] = useState<GameSession | null>(null);
@@ -372,11 +370,6 @@ export default function GamePage() {
}
};
const handleQuickAction = (action: string) => {
setInput(action);
inputRef.current?.focus();
};
if (isInitialLoading) {
return (
<div className="game-page">
-1
View File
@@ -125,7 +125,6 @@ export default function StoriesPage() {
<p className="story-description">{story.description}</p>
<div className="story-meta">
<span>🌍 {story.world.name}</span>
<span>👤 {story.player?.name || "Герой"}</span>
</div>
<div className="story-actions">
<Link to={`/story/${story.id}`} className="btn btn-view">
+1 -1
View File
@@ -99,7 +99,7 @@ export default function StoryDetailPage() {
};
// Примерный подсчёт токенов (1 токен ≈ 3 символа для русского текста)
const estimateTokens = (messages: typeof session.messages) => {
const estimateTokens = (messages: typeof session?.messages) => {
if (!messages || messages.length === 0) return 0;
const totalChars = messages.reduce(
(sum, msg) => sum + msg.content.length,