mirror of
https://github.com/aljazceru/claude-code-viewer.git
synced 2026-01-26 17:04:23 +01:00
feat: implement watch claude code project folders and sync state
This commit is contained in:
13
src/app/components/ServerEventsProvider.tsx
Normal file
13
src/app/components/ServerEventsProvider.tsx
Normal file
@@ -0,0 +1,13 @@
|
||||
"use client";
|
||||
|
||||
import { useServerEvents } from "@/hooks/useServerEvents";
|
||||
|
||||
interface ServerEventsProviderProps {
|
||||
children: React.ReactNode;
|
||||
}
|
||||
|
||||
export function ServerEventsProvider({ children }: ServerEventsProviderProps) {
|
||||
useServerEvents();
|
||||
|
||||
return <>{children}</>;
|
||||
}
|
||||
@@ -2,6 +2,7 @@ import type { Metadata } from "next";
|
||||
import { Geist, Geist_Mono } from "next/font/google";
|
||||
import { QueryClientProviderWrapper } from "../lib/api/QueryClientProviderWrapper";
|
||||
import { RootErrorBoundary } from "./components/RootErrorBoundary";
|
||||
import { ServerEventsProvider } from "./components/ServerEventsProvider";
|
||||
|
||||
import "./globals.css";
|
||||
|
||||
@@ -16,8 +17,8 @@ const geistMono = Geist_Mono({
|
||||
});
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "Create Next App",
|
||||
description: "Generated by create next app",
|
||||
title: "Claude Code Viewer",
|
||||
description: "Web Viewer for Claude Code history",
|
||||
};
|
||||
|
||||
export default function RootLayout({
|
||||
@@ -26,12 +27,14 @@ export default function RootLayout({
|
||||
children: React.ReactNode;
|
||||
}>) {
|
||||
return (
|
||||
<html lang="en">
|
||||
<html lang="ja">
|
||||
<body
|
||||
className={`${geistSans.variable} ${geistMono.variable} antialiased`}
|
||||
>
|
||||
<RootErrorBoundary>
|
||||
<QueryClientProviderWrapper>{children}</QueryClientProviderWrapper>
|
||||
<QueryClientProviderWrapper>
|
||||
<ServerEventsProvider>{children}</ServerEventsProvider>
|
||||
</QueryClientProviderWrapper>
|
||||
</RootErrorBoundary>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -12,6 +12,5 @@ export const useProject = (projectId: string) => {
|
||||
return await response.json();
|
||||
},
|
||||
refetchOnReconnect: true,
|
||||
refetchInterval: 10 * 1000,
|
||||
});
|
||||
};
|
||||
|
||||
@@ -3,7 +3,7 @@ import { honoClient } from "../../../../../../lib/api/client";
|
||||
|
||||
export const useSessionQuery = (projectId: string, sessionId: string) => {
|
||||
return useSuspenseQuery({
|
||||
queryKey: ["conversations", sessionId],
|
||||
queryKey: ["sessions", sessionId],
|
||||
queryFn: async () => {
|
||||
const response = await honoClient.api.projects[":projectId"].sessions[
|
||||
":sessionId"
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
import { HistoryIcon } from "lucide-react";
|
||||
import { ProjectList } from "./components/ProjectList";
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
export const fetchCache = "force-no-store";
|
||||
|
||||
export default async function ProjectsPage() {
|
||||
return (
|
||||
<div className="container mx-auto px-4 py-8">
|
||||
|
||||
Reference in New Issue
Block a user