import { Header } from "./Header";
import { Sidebar } from "./Sidebar";
import { Dashboard } from "@/components/dashboard/Dashboard";
import Repository from "../repositories/Repository";
import Providers from "./Providers";
import { ConfigTabs } from "../config/ConfigTabs";
import { ActivityLog } from "../activity/ActivityLog";
import { Organization } from "../organizations/Organization";
import { Toaster } from "@/components/ui/sonner";
import { useAuth } from "@/hooks/useAuth";
import { useRepoSync } from "@/hooks/useSyncRepo";
interface AppProps {
page:
| "dashboard"
| "repositories"
| "organizations"
| "configuration"
| "activity-log";
"client:load"?: boolean;
"client:idle"?: boolean;
"client:visible"?: boolean;
"client:media"?: string;
"client:only"?: boolean | string;
}
export default function App({ page }: AppProps) {
return (
);
}
function AppWithProviders({ page }: AppProps) {
const { user } = useAuth();
useRepoSync({
userId: user?.id,
enabled: user?.syncEnabled,
interval: user?.syncInterval,
lastSync: user?.lastSync,
nextSync: user?.nextSync,
});
return (
{page === "dashboard" && }
{page === "repositories" && }
{page === "organizations" && }
{page === "configuration" && }
{page === "activity-log" && }
);
}