Welcome to Devr.AI
-
Enter a GitHub repository URL to analyze its stats.
+
{message}
void;
}
-const AnalyticsPage: React.FC
= ({ repoData }) => {
- if (!repoData || !repoData.pull_requests) {
- return No data available. Please analyze a repository first.
;
- }
+const AnalyticsPage: React.FC = ({ repoData, setRepoData }) => {
+ if (!repoData) {
+ return {})} message='Please analyze a repository first to get started.' />;
+ }
+ if (!repoData.pull_requests) {
+ return (
+
+ No data available for pull requests. Please analyze a repository
+ first.
+
+ );
+ }
const [selectedRange, setSelectedRange] = React.useState('Last Week');
const [activeIndex, setActiveIndex] = React.useState(0);
@@ -349,7 +358,7 @@ const AnalyticsPage: React.FC = ({ repoData }) => {
);
-}
+};
const renderActiveShape = (props: any) => {
const {
diff --git a/frontend/src/components/pages/PullRequestsPage.tsx b/frontend/src/components/pages/PullRequestsPage.tsx
index 1859f501..764cc39a 100644
--- a/frontend/src/components/pages/PullRequestsPage.tsx
+++ b/frontend/src/components/pages/PullRequestsPage.tsx
@@ -1,4 +1,5 @@
import React from 'react';
+import LandingPage from '../landing/LandingPage';
import { motion } from 'framer-motion';
interface PullRequest {
@@ -17,11 +18,15 @@ interface PullRequest {
interface Props {
repoData: { pull_requests: { details: PullRequest[] } } | null;
+ setRepoData?: (data: any) => void;
}
-const PullRequestsPage: React.FC