This commit is contained in:
bkellam 2024-09-10 22:23:40 -07:00
parent 1283f6487f
commit 957f499584
3 changed files with 16 additions and 9 deletions

View file

@ -1,8 +1,11 @@
"use server";
import { NavigationMenu } from "../navigationMenu";
import { DataTable } from "@/components/ui/data-table";
import { columns, RepositoryColumnInfo } from "./columns";
import { listRepositories } from "@/lib/server/searchService";
import { isServiceError } from "@/lib/utils";
import { Suspense } from "react";
export default async function ReposPage() {
const _repos = await listRepositories();
@ -27,17 +30,21 @@ export default async function ReposPage() {
indexedFiles: repo.Stats.Documents,
commitUrlTemplate: repo.Repository.CommitURLTemplate,
}
});
}).sort((a, b) => {
return new Date(b.lastIndexed).getTime() - new Date(a.lastIndexed).getTime();
})
return (
<div className="h-screen flex flex-col items-center">
<NavigationMenu />
<Suspense fallback={<div>Loading...</div>}>
<DataTable
columns={columns}
data={repos}
searchKey="name"
searchPlaceholder="Search repositories..."
/>
</Suspense>
</div>
)
}

View file

@ -98,7 +98,7 @@ export const CodePreviewPanel = ({
}
highlightRanges(selectedMatchIndex, ranges, editorRef.current.view);
}, [ranges, selectedMatchIndex]);
}, [ranges, selectedMatchIndex, file]);
const onUpClicked = useCallback(() => {
onSelectedMatchIndexChange(selectedMatchIndex - 1);

View file

@ -12,7 +12,7 @@ export const useThemeNormalized = (defaultTheme: "light" | "dark" = "light") =>
}
return _theme ?? defaultTheme;
}, [_theme, systemTheme]);
}, [_theme, systemTheme, defaultTheme]);
return {
theme,