Story Collections Feature

This commit is contained in:
Stefan Hardegger
2025-07-25 14:15:23 +02:00
parent 9dd8855914
commit 312093ae2e
42 changed files with 5398 additions and 45 deletions

View File

@@ -10,10 +10,20 @@ import Button from '../ui/Button';
interface StoryCardProps {
story: Story;
viewMode: 'grid' | 'list';
onUpdate: () => void;
onUpdate?: () => void;
showSelection?: boolean;
isSelected?: boolean;
onSelect?: () => void;
}
export default function StoryCard({ story, viewMode, onUpdate }: StoryCardProps) {
export default function StoryCard({
story,
viewMode,
onUpdate,
showSelection = false,
isSelected = false,
onSelect
}: StoryCardProps) {
const [rating, setRating] = useState(story.rating || 0);
const [updating, setUpdating] = useState(false);
@@ -24,7 +34,7 @@ export default function StoryCard({ story, viewMode, onUpdate }: StoryCardProps)
setUpdating(true);
await storyApi.updateRating(story.id, newRating);
setRating(newRating);
onUpdate();
onUpdate?.();
} catch (error) {
console.error('Failed to update rating:', error);
} finally {