Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

862 B
Raw Blame
import { useEffect, useState } from "react";
import { useSQLReviewStore } from "@/stores/sqlReview";
import {
  ReviewCreation,
  type ReviewCreationProps,
} from "../../components/sql-review/ReviewCreation";

export function SQLReviewCreationPage(props: ReviewCreationProps) {
  return (
    <div className="pt-4 h-full min-h-0 flex flex-col">
      <ReviewCreation {...props} />
    </div>
  );
}

export function SQLReviewCreatePage() {
  useEffect(() => {
    useSQLReviewStore.getState().fetchReviewPolicyList();
  }, []);

  const [selectedResources] = useState(() => {
    const url = new URL(window.location.href);
    const resource = url.searchParams.get("attachedResource") ?? "";
    return resource ? [resource] : [];
  });

  return (
    <SQLReviewCreationPage
      selectedRuleList={[]}
      selectedResources={selectedResources}
    />
  );
}