chore(services): update components based on recent changes
Changes: services/frontend/src/features/messages/index.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
This commit is contained in:
@@ -29,7 +29,7 @@ interface MessagesPanelProps {
|
|||||||
loadingMore?: boolean;
|
loadingMore?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
type AiFilter = "all" | "clean" | "flagged" | "error" | "pending";
|
type AiFilter = "all" | "analyzed" | "clean" | "flagged" | "error" | "pending";
|
||||||
|
|
||||||
export function MessagesPanel({
|
export function MessagesPanel({
|
||||||
guildName,
|
guildName,
|
||||||
@@ -44,7 +44,7 @@ export function MessagesPanel({
|
|||||||
const [searchResults, setSearchResults] = useState<MessageRecord[]>([]);
|
const [searchResults, setSearchResults] = useState<MessageRecord[]>([]);
|
||||||
const [isSearching, setIsSearching] = useState(false);
|
const [isSearching, setIsSearching] = useState(false);
|
||||||
const [showSearch, setShowSearch] = useState(false);
|
const [showSearch, setShowSearch] = useState(false);
|
||||||
const [aiFilter, setAiFilter] = useState<AiFilter>("all");
|
const [aiFilter, setAiFilter] = useState<AiFilter>("analyzed");
|
||||||
const [viewTab, setViewTab] = useState<"all" | "images">("all");
|
const [viewTab, setViewTab] = useState<"all" | "images">("all");
|
||||||
const [retryingAll, setRetryingAll] = useState(false);
|
const [retryingAll, setRetryingAll] = useState(false);
|
||||||
const [retriedCount, setRetriedCount] = useState<number | null>(null);
|
const [retriedCount, setRetriedCount] = useState<number | null>(null);
|
||||||
@@ -89,6 +89,8 @@ export function MessagesPanel({
|
|||||||
if (aiFilter === "all") return base;
|
if (aiFilter === "all") return base;
|
||||||
return base.filter((m) => {
|
return base.filter((m) => {
|
||||||
const status = m.ai_status ?? "pending";
|
const status = m.ai_status ?? "pending";
|
||||||
|
if (aiFilter === "analyzed")
|
||||||
|
return status !== "pending" && status !== null && status !== undefined;
|
||||||
if (aiFilter === "pending")
|
if (aiFilter === "pending")
|
||||||
return status === "pending" || status === null || status === undefined;
|
return status === "pending" || status === null || status === undefined;
|
||||||
return status === aiFilter;
|
return status === aiFilter;
|
||||||
@@ -240,7 +242,7 @@ export function MessagesPanel({
|
|||||||
)}
|
)}
|
||||||
<div className="ml-auto flex items-center gap-1.5">
|
<div className="ml-auto flex items-center gap-1.5">
|
||||||
<Filter className="h-4 w-4 text-primary" />
|
<Filter className="h-4 w-4 text-primary" />
|
||||||
{(["all", "clean", "flagged", "error", "pending"] as AiFilter[]).map(
|
{(["all", "analyzed", "clean", "flagged", "error", "pending"] as AiFilter[]).map(
|
||||||
(f) => (
|
(f) => (
|
||||||
<button
|
<button
|
||||||
key={f}
|
key={f}
|
||||||
|
|||||||
Reference in New Issue
Block a user