sourcebot/packages/web/src/app/[domain]/settings/secrets/page.tsx
2025-08-22 14:48:29 -04:00

36 lines
No EOL
1 KiB
TypeScript

import { getSecrets } from "@/actions";
import { SecretsList } from "./components/secretsList";
import { isServiceError } from "@/lib/utils";
import { ImportSecretCard } from "./components/importSecretCard";
import { ServiceErrorException } from "@/lib/serviceError";
interface SecretsPageProps {
params: Promise<{
domain: string;
}>
}
export default async function SecretsPage(props: SecretsPageProps) {
const params = await props.params;
const {
domain
} = params;
const secrets = await getSecrets(domain);
if (isServiceError(secrets)) {
throw new ServiceErrorException(secrets);
}
return (
<div className="flex flex-col gap-6">
<div>
<h3 className="text-lg font-medium">Manage Secrets</h3>
<p className="text-sm text-muted-foreground">These secrets grant Sourcebot access to private code.</p>
</div>
<SecretsList secrets={secrets} />
<ImportSecretCard className="mt-4" />
</div>
)
}