mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-16 16:19:40 +02:00
- 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>
58 lines
1.2 KiB
Svelte
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>
|