Skip to content

Commit

Permalink
used already present component
Browse files Browse the repository at this point in the history
  • Loading branch information
HussainKhanSherwani committed Feb 7, 2025
1 parent 7be174d commit 8b59cd5
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 66 deletions.
6 changes: 4 additions & 2 deletions insights-ui/src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import React from 'react';
import PageWrapper from '@dodao/web-core/components/core/page/PageWrapper';
import ProjectSummaryCard from '@/components/projects/ProjectSummaryCard';
import AddProjectButton from '@/components/ui/AddProjectButton';
import { isAdmin } from '@/util/auth/isAdmin';
import PrivateWrapper from '@/components/auth/PrivateWrapper';

export default async function Home() {
const apiUrl = `${getBaseUrl()}/api/crowd-funding/projects`;
Expand All @@ -20,7 +20,9 @@ export default async function Home() {
<p className="my-2 text-sm text-color">A list of all the projects.</p>
</div>
</div>
{isAdmin() && <AddProjectButton />}
<PrivateWrapper>
<AddProjectButton />
</PrivateWrapper>
<Grid4Cols>
{data.projectIds!.length > 0 ? (
data.projectIds.map((projectId: string) => <ProjectSummaryCard key={projectId} projectId={projectId} />)
Expand Down
53 changes: 0 additions & 53 deletions insights-ui/src/components/projects/Elipsis.tsx

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ export default function ProjectActionsDropdown({ projectId, postGenerateReport }
postGenerateReport?.(projectId, { success, message });
}
}}
className="pr-4"
/>
);
}
17 changes: 7 additions & 10 deletions insights-ui/src/components/projects/ProjectSummaryCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,12 @@ import { shorten } from '@dodao/web-core/utils/utils';
import Link from 'next/link';
import React from 'react';
import { InsightsConstants } from '@/util/insights-constants';
import { regenerateReport } from '@/util/regenerate';
import EllipsisDropdown from '@dodao/web-core/components/core/dropdowns/EllipsisDropdown';
import { isAdmin } from '@/util/auth/isAdmin';
import Elipsis from './Elipsis';
import ProjectActionsDropdown from './ProjectActionsDropdown';
import PrivateWrapper from '../auth/PrivateWrapper';

interface ProjectSummaryCardProps {
projectId: string;
}
const MODEL_OPTIONS = [
{ key: 'gpt-4o', label: 'gpt-4o' },
{ key: 'gpt-4o-mini', label: 'gpt-4o-mini' },
];

const ProjectSummaryCard: React.FC<ProjectSummaryCardProps> = ({ projectId }) => {
function formatProjectName(projectId: string): string {
Expand All @@ -29,8 +23,11 @@ const ProjectSummaryCard: React.FC<ProjectSummaryCardProps> = ({ projectId }) =>
<Card>
<Link href={`/crowd-funding/projects/${projectId}`} className="card blog-card w-inline-block h-full w-full">
<div className="relative w-full">
{isAdmin() && <Elipsis projectId={projectId} />}

<PrivateWrapper>
<div className="absolute top-2 right-2 py-2 pl-3 pr-4 text-right font-medium sm:pr-0">
<ProjectActionsDropdown projectId={projectId} />
</div>
</PrivateWrapper>
<Thumbnail
src={`https://${InsightsConstants.S3_BUCKET_NAME}.s3.us-east-1.amazonaws.com/images/${projectId}`}
entityId={projectId}
Expand Down

0 comments on commit 8b59cd5

Please sign in to comment.