mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-23 10:51:12 -05:00
feat: Add refresh button to Admin Inbox
This commit is contained in:
@@ -14,6 +14,7 @@ import {
|
|||||||
ArrowUpRight,
|
ArrowUpRight,
|
||||||
ArrowDownLeft,
|
ArrowDownLeft,
|
||||||
Loader2,
|
Loader2,
|
||||||
|
RefreshCw,
|
||||||
} from 'lucide-react';
|
} from 'lucide-react';
|
||||||
import { supabase } from '@/integrations/supabase/client';
|
import { supabase } from '@/integrations/supabase/client';
|
||||||
import { Button } from '@/components/ui/button';
|
import { Button } from '@/components/ui/button';
|
||||||
@@ -259,6 +260,10 @@ export default function AdminContact() {
|
|||||||
return cat?.label || category;
|
return cat?.label || category;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const handleRefreshSubmissions = () => {
|
||||||
|
queryClient.invalidateQueries({ queryKey: ['admin-contact-submissions'] });
|
||||||
|
};
|
||||||
|
|
||||||
// Show loading state while roles are being fetched
|
// Show loading state while roles are being fetched
|
||||||
if (rolesLoading) {
|
if (rolesLoading) {
|
||||||
return (
|
return (
|
||||||
@@ -335,11 +340,22 @@ export default function AdminContact() {
|
|||||||
return (
|
return (
|
||||||
<AdminLayout>
|
<AdminLayout>
|
||||||
{/* Header */}
|
{/* Header */}
|
||||||
<div className="mb-8">
|
<div className="mb-8 flex items-start justify-between">
|
||||||
<h1 className="text-4xl font-bold mb-2">Contact Submissions</h1>
|
<div>
|
||||||
<p className="text-muted-foreground">
|
<h1 className="text-4xl font-bold mb-2">Contact Submissions</h1>
|
||||||
Manage and respond to user contact form submissions
|
<p className="text-muted-foreground">
|
||||||
</p>
|
Manage and respond to user contact form submissions
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<Button
|
||||||
|
variant="outline"
|
||||||
|
size="icon"
|
||||||
|
onClick={handleRefreshSubmissions}
|
||||||
|
disabled={isLoading}
|
||||||
|
title="Refresh submissions"
|
||||||
|
>
|
||||||
|
<RefreshCw className={`h-4 w-4 ${isLoading ? 'animate-spin' : ''}`} />
|
||||||
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Stats Cards */}
|
{/* Stats Cards */}
|
||||||
|
|||||||
Reference in New Issue
Block a user