Update image URL handling and edit link in Event Themes
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:
@@ -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>
|
||||||
|
|||||||
Reference in New Issue
Block a user