feat: Redux-Integration für Meldungen, Anzeige von 'v' statt 's' in UI

This commit is contained in:
ISA
2025-06-30 09:00:33 +02:00
parent 62de915485
commit cd46f59f7c
6 changed files with 22 additions and 13 deletions

View File

@@ -4,6 +4,7 @@ import React, { useState, useEffect } from "react";
import DateRangePickerMeldungen from "@/components/main/reports/DateRangePickerMeldungen";
import { useSelector, useDispatch } from "react-redux";
import { getMessagesThunk } from "@/redux/thunks/getMessagesThunk";
import type { AppDispatch } from "@/redux/store";
type Meldung = {
t: string;
@@ -11,14 +12,17 @@ type Meldung = {
c: string;
m: string;
i: string;
v: string; // NEU: für Anzeige
v: string;
};
export default function Messages() {
const dispatch = useDispatch();
const { data: messages, loading } = useSelector(
(state: any) => state.messages
);
const dispatch = useDispatch<AppDispatch>();
type RootState = {
messages: {
data: Meldung[];
};
// add other slices if needed
};
const { data: messages } = useSelector((state: RootState) => state.messages);
const [sourceFilter, setSourceFilter] = useState<string>("Alle");
@@ -69,8 +73,8 @@ export default function Messages() {
>
<option value="Alle">Alle Quellen</option>
{allSources.map((src) => (
<option key={src} value={src}>
{src}
<option key={String(src)} value={String(src)}>
{String(src)}
</option>
))}
</select>