Update image URL handling and edit link in Event Themes
Some checks failed
Build and Push Docker Images / changes (push) Successful in 4s
Build and Push Docker Images / build-backend (push) Has been skipped
Build and Push Docker Images / build-frontend (push) Failing after 49s

Replaced direct `preview_image_url` usage with `getServerFileUrl` for consistent file URL handling. Updated the "Edit Theme" button to navigate to the `/edit` path for improved routing clarity.
This commit is contained in:
2025-03-14 01:33:57 +01:00
parent 996727aa13
commit 187f52bbe0

View File

@@ -16,6 +16,7 @@ import Image from "next/image";
import Link from "next/link"; import Link from "next/link";
import { Loader2Icon, PaletteIcon } from "lucide-react"; import { Loader2Icon, PaletteIcon } from "lucide-react";
import { useEventThemes } from "@/context/event-theme-context"; import { useEventThemes } from "@/context/event-theme-context";
import { getServerFileUrl } from "@/lib/utils";
export default function EventThemesPage() { export default function EventThemesPage() {
// const { data: themes, isLoading } = useQuery({ // const { data: themes, isLoading } = useQuery({
@@ -69,7 +70,7 @@ export default function EventThemesPage() {
<CardHeader className="p-0 relative h-48 bg-gray-50 dark:bg-gray-800"> <CardHeader className="p-0 relative h-48 bg-gray-50 dark:bg-gray-800">
{theme.preview_image_url ? ( {theme.preview_image_url ? (
<Image <Image
src={theme.preview_image_url} src={getServerFileUrl(theme.preview_image_url) || ""}
alt={`${theme.name} Preview`} alt={`${theme.name} Preview`}
style={{ objectFit: "cover" }} style={{ objectFit: "cover" }}
fill fill
@@ -96,7 +97,7 @@ export default function EventThemesPage() {
)} )}
</div> </div>
<Button variant="outline" size="sm" asChild className="w-full"> <Button variant="outline" size="sm" asChild className="w-full">
<Link href={`/dashboard/event-themes/${theme.id}`}> <Link href={`/dashboard/event-themes/${theme.id}/edit`}>
Edit Theme Edit Theme
</Link> </Link>
</Button> </Button>