Fix: 에러 수정

This commit is contained in:
jhynsoo 2024-09-20 11:04:13 +09:00
parent 1f8e86d979
commit 51ee48f322

View File

@ -1,4 +1,4 @@
import { useNavigate, useParams } from 'react-router-dom'; import { useParams } from 'react-router-dom';
import ProjectCard from '@/components/ProjectCard'; import ProjectCard from '@/components/ProjectCard';
import { Smile } from 'lucide-react'; import { Smile } from 'lucide-react';
import ProjectCreateModal from '../components/ProjectCreateModal'; import ProjectCreateModal from '../components/ProjectCreateModal';
@ -14,7 +14,6 @@ export default function WorkspaceBrowseDetail() {
const workspaceId = Number(params.workspaceId); const workspaceId = Number(params.workspaceId);
const { profile } = useAuthStore(); const { profile } = useAuthStore();
const memberId = profile?.id ?? 0; const memberId = profile?.id ?? 0;
const navigate = useNavigate();
const { data: workspaceData } = useWorkspaceQuery(workspaceId, memberId); const { data: workspaceData } = useWorkspaceQuery(workspaceId, memberId);
const { data: projectsResponse, isError } = useProjectListQuery(workspaceId, memberId); const { data: projectsResponse, isError } = useProjectListQuery(workspaceId, memberId);
@ -43,7 +42,6 @@ export default function WorkspaceBrowseDetail() {
<ProjectList <ProjectList
projects={projects} projects={projects}
workspaceId={workspaceId} workspaceId={workspaceId}
navigate={navigate}
/> />
)} )}
</div> </div>
@ -86,15 +84,7 @@ function EmptyStateMessage({ workspaceId }: { workspaceId: number }) {
); );
} }
function ProjectList({ function ProjectList({ projects, workspaceId }: { projects: ProjectResponse[]; workspaceId: number }) {
projects,
workspaceId,
navigate,
}: {
projects: ProjectResponse[];
workspaceId: number;
navigate: ReturnType<typeof useNavigate>;
}) {
if (projects.length === 0) { if (projects.length === 0) {
return ( return (
<div className="flex h-full w-full flex-col items-center justify-center"> <div className="flex h-full w-full flex-col items-center justify-center">