diff --git a/vibn-frontend/components/project/project-icon-rail.tsx b/vibn-frontend/components/project/project-icon-rail.tsx index 92c3b456..619d6fc8 100644 --- a/vibn-frontend/components/project/project-icon-rail.tsx +++ b/vibn-frontend/components/project/project-icon-rail.tsx @@ -91,14 +91,24 @@ export function ProjectIconRail({ workspace, projectId }: Props) { ); } -import { Monitor, Smartphone, RotateCw, Wand2, Maximize2 } from "lucide-react"; +import { Monitor, Smartphone, RotateCw, ExternalLink } from "lucide-react"; import { usePreviewToolbarStore } from "./preview-toolbar/preview-toolbar-state"; +import { useAnatomy } from "@/components/project/use-anatomy"; +import { useParams } from "next/navigation"; function PreviewDeviceToggles() { const deviceMode = usePreviewToolbarStore((s) => s.deviceMode); const setDeviceMode = usePreviewToolbarStore((s) => s.setDeviceMode); const triggerRefresh = usePreviewToolbarStore((s) => s.triggerRefresh); + const params = useParams(); + const projectId = params?.projectId as string; + const { anatomy } = useAnatomy(projectId); + + const previews = anatomy?.hosting.previews ?? []; + const running = previews.find((p) => p.state === "running"); + const displayUrl = running?.url ?? ""; + return (
- / + 🌐 -
- -
- - - + {displayUrl && ( + + + + )}
);