Legend:
- Unmodified
- Added
- Removed
-
chapterx-frontend/src/components/writer/AISuggestionPanel.tsx
r3ae4bab ra6e33d1 100 100 } 101 101 102 export const AISuggestionPanel: React.FC<AISuggestionPanelProps> = ({ chapterId , storyId}) => {102 export const AISuggestionPanel: React.FC<AISuggestionPanelProps> = ({ chapterId }) => { 103 103 const { aiSuggestions, acceptSuggestion, rejectSuggestion, fetchSuggestions } = useStoryStore() 104 104 const { addToast } = useUIStore() … … 108 108 useEffect(() => { 109 109 setLoading(true) 110 fetchSuggestions( ).finally(() => setLoading(false))110 fetchSuggestions(chapterId).finally(() => setLoading(false)) 111 111 }, [chapterId]) 112 112 113 // Filter by storyId if available (backend), else fall back to chapterId (mock) 114 const chapterSuggestions = aiSuggestions.filter(s => 115 storyId ? (s as any).story_id === storyId : s.chapter_id === chapterId 116 ) 113 // Backend already scopes results to this chapter via NEED_APPROVAL 114 const chapterSuggestions = aiSuggestions 117 115 const pending = chapterSuggestions.filter(s => s.accepted === null) 118 116 const accepted = chapterSuggestions.filter(s => s.accepted === true)
Note:
See TracChangeset
for help on using the changeset viewer.
