managarten/packages/shared-feedback-ui/src/FeedbackList.svelte
Till-JS 819e4c9a2f feat(feedback): add centralized feedback system with AI-generated titles
- Add shared-feedback-types package with TypeScript types
- Add shared-feedback-service package with factory function
- Add shared-feedback-ui package with Svelte 5 components
- Add feedback module to mana-core-auth backend
- Add AI service using Gemini 2.0 Flash for title/category generation
- Add database schema and migration for feedback tables
- Integrate feedback page into Chat web app
- Add CORS support for X-App-Id header
- Add COMMANDS.md documentation for all dev commands

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-29 22:46:37 +01:00

58 lines
1.2 KiB
Svelte

<script lang="ts">
import type { Feedback } from '@manacore/shared-feedback-types';
import FeedbackCard from './FeedbackCard.svelte';
interface Props {
items: Feedback[];
currentUserId?: string;
onVote: (feedbackId: string, hasVoted: boolean) => void;
votingDisabled?: boolean;
emptyMessage?: string;
}
let {
items,
currentUserId,
onVote,
votingDisabled = false,
emptyMessage = 'Noch kein Feedback vorhanden',
}: Props = $props();
</script>
<div class="feedback-list">
{#if items.length === 0}
<div class="feedback-list__empty">
<p>{emptyMessage}</p>
</div>
{:else}
{#each items as feedback (feedback.id)}
<FeedbackCard
{feedback}
{onVote}
{votingDisabled}
isOwner={currentUserId === feedback.userId}
/>
{/each}
{/if}
</div>
<style>
.feedback-list {
display: flex;
flex-direction: column;
gap: 1rem;
}
.feedback-list__empty {
padding: 2rem;
text-align: center;
border-radius: 0.75rem;
background: hsl(var(--color-surface, 0 0% 100%) / 0.5);
border: 1px dashed hsl(var(--color-border, 0 0% 90%));
}
.feedback-list__empty p {
margin: 0;
color: hsl(var(--color-muted-foreground, 0 0% 40%));
}
</style>