Add Znakopis feature with document and sentence management
- Implemented Znakopis page with document and sentence CRUD operations - Added backend routes for documents and sentences - Created UI components for sentence editing and display - Added sentence store for state management - Integrated select component for document selection - Updated README with Phase 3 completion status - Removed obsolete fix-colors.md file
This commit is contained in:
@@ -5,8 +5,14 @@ import { WordGrid } from '../components/dictionary/WordGrid';
|
||||
import { WordDetailModal } from '../components/dictionary/WordDetailModal';
|
||||
import { Term, TermFilters } from '../types/term';
|
||||
import { fetchTerms } from '../lib/termApi';
|
||||
import { useSentenceStore } from '../stores/sentenceStore';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import { toast } from 'sonner';
|
||||
|
||||
function Dictionary() {
|
||||
const navigate = useNavigate();
|
||||
const addToken = useSentenceStore((state) => state.addToken);
|
||||
|
||||
const [terms, setTerms] = useState<Term[]>([]);
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [selectedTerm, setSelectedTerm] = useState<Term | null>(null);
|
||||
@@ -54,9 +60,14 @@ function Dictionary() {
|
||||
};
|
||||
|
||||
const handleAddToSentence = (term: Term) => {
|
||||
// TODO: Implement in Phase 3 (Znakopis)
|
||||
console.log('Add to sentence:', term);
|
||||
alert(`Dodavanje riječi "${term.wordText}" u rečenicu će biti implementirano u fazi 3.`);
|
||||
addToken(term);
|
||||
toast.success(`Dodano: "${term.wordText}"`, {
|
||||
description: 'Riječ je dodana u rečenicu. Idite na Znakopis za uređivanje.',
|
||||
action: {
|
||||
label: 'Idi na Znakopis',
|
||||
onClick: () => navigate('/znakopis'),
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user