mirror of
https://github.com/sourcebot-dev/sourcebot.git
synced 2025-12-12 04:15:30 +00:00
nits
This commit is contained in:
parent
1283f6487f
commit
957f499584
3 changed files with 16 additions and 9 deletions
|
|
@ -1,8 +1,11 @@
|
||||||
|
"use server";
|
||||||
|
|
||||||
import { NavigationMenu } from "../navigationMenu";
|
import { NavigationMenu } from "../navigationMenu";
|
||||||
import { DataTable } from "@/components/ui/data-table";
|
import { DataTable } from "@/components/ui/data-table";
|
||||||
import { columns, RepositoryColumnInfo } from "./columns";
|
import { columns, RepositoryColumnInfo } from "./columns";
|
||||||
import { listRepositories } from "@/lib/server/searchService";
|
import { listRepositories } from "@/lib/server/searchService";
|
||||||
import { isServiceError } from "@/lib/utils";
|
import { isServiceError } from "@/lib/utils";
|
||||||
|
import { Suspense } from "react";
|
||||||
|
|
||||||
export default async function ReposPage() {
|
export default async function ReposPage() {
|
||||||
const _repos = await listRepositories();
|
const _repos = await listRepositories();
|
||||||
|
|
@ -27,17 +30,21 @@ export default async function ReposPage() {
|
||||||
indexedFiles: repo.Stats.Documents,
|
indexedFiles: repo.Stats.Documents,
|
||||||
commitUrlTemplate: repo.Repository.CommitURLTemplate,
|
commitUrlTemplate: repo.Repository.CommitURLTemplate,
|
||||||
}
|
}
|
||||||
});
|
}).sort((a, b) => {
|
||||||
|
return new Date(b.lastIndexed).getTime() - new Date(a.lastIndexed).getTime();
|
||||||
|
})
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="h-screen flex flex-col items-center">
|
<div className="h-screen flex flex-col items-center">
|
||||||
<NavigationMenu />
|
<NavigationMenu />
|
||||||
|
<Suspense fallback={<div>Loading...</div>}>
|
||||||
<DataTable
|
<DataTable
|
||||||
columns={columns}
|
columns={columns}
|
||||||
data={repos}
|
data={repos}
|
||||||
searchKey="name"
|
searchKey="name"
|
||||||
searchPlaceholder="Search repositories..."
|
searchPlaceholder="Search repositories..."
|
||||||
/>
|
/>
|
||||||
|
</Suspense>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
@ -98,7 +98,7 @@ export const CodePreviewPanel = ({
|
||||||
}
|
}
|
||||||
|
|
||||||
highlightRanges(selectedMatchIndex, ranges, editorRef.current.view);
|
highlightRanges(selectedMatchIndex, ranges, editorRef.current.view);
|
||||||
}, [ranges, selectedMatchIndex]);
|
}, [ranges, selectedMatchIndex, file]);
|
||||||
|
|
||||||
const onUpClicked = useCallback(() => {
|
const onUpClicked = useCallback(() => {
|
||||||
onSelectedMatchIndexChange(selectedMatchIndex - 1);
|
onSelectedMatchIndexChange(selectedMatchIndex - 1);
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ export const useThemeNormalized = (defaultTheme: "light" | "dark" = "light") =>
|
||||||
}
|
}
|
||||||
|
|
||||||
return _theme ?? defaultTheme;
|
return _theme ?? defaultTheme;
|
||||||
}, [_theme, systemTheme]);
|
}, [_theme, systemTheme, defaultTheme]);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
theme,
|
theme,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue