Refactor: 필요없는 멤버관리 제거, 이유는 멤버관리가 프로젝트 단위별로 이루어지기 때문에 워크 스페이스에서 필요없음
This commit is contained in:
parent
bcf6fcdd35
commit
ab16706f89
@ -2,17 +2,9 @@ import { useParams } from 'react-router-dom';
|
||||
import ProjectCard from '@/components/ProjectCard';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Workspace } from '@/types';
|
||||
import { Plus, Smile, Users } from 'lucide-react';
|
||||
import { Plus, Smile } from 'lucide-react';
|
||||
import { Dialog, DialogContent, DialogHeader, DialogTrigger } from '../ui/dialogCustom';
|
||||
import WorkSpaceCreateForm from '../WorkSpaceCreateModal/WorkSpaceCreateForm';
|
||||
import MemberManageForm from '../MemberManageModal/MemberManageForm';
|
||||
|
||||
type Role = 'admin' | 'editor' | 'viewer';
|
||||
|
||||
interface Member {
|
||||
email: string;
|
||||
role: Role;
|
||||
}
|
||||
|
||||
export default function WorkspaceBrowseDetail() {
|
||||
const { workspaceId } = useParams<{ workspaceId: string }>();
|
||||
@ -27,78 +19,20 @@ export default function WorkspaceBrowseDetail() {
|
||||
id: numericWorkspaceId,
|
||||
name: `workspace-${workspaceId}`,
|
||||
projects: [
|
||||
{
|
||||
id: 1,
|
||||
name: 'project1',
|
||||
type: 'Detection',
|
||||
children: [],
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: 'project2',
|
||||
type: 'Detection',
|
||||
children: [],
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
name: 'project3',
|
||||
type: 'Detection',
|
||||
children: [],
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
name: 'project4',
|
||||
type: 'Detection',
|
||||
children: [],
|
||||
},
|
||||
{
|
||||
id: 5,
|
||||
name: 'project5',
|
||||
type: 'Detection',
|
||||
children: [],
|
||||
},
|
||||
{ id: 1, name: 'project1', type: 'Detection', children: [] },
|
||||
{ id: 2, name: 'project2', type: 'Detection', children: [] },
|
||||
{ id: 3, name: 'project3', type: 'Detection', children: [] },
|
||||
{ id: 4, name: 'project4', type: 'Detection', children: [] },
|
||||
{ id: 5, name: 'project5', type: 'Detection', children: [] },
|
||||
],
|
||||
};
|
||||
|
||||
const members: Array<Member> = [
|
||||
{ email: 'admin1@example.com', role: 'admin' },
|
||||
{ email: 'admin2@example.com', role: 'admin' },
|
||||
{ email: 'viewer3@example.com', role: 'viewer' },
|
||||
{ email: 'editor1@example.com', role: 'editor' },
|
||||
{ email: 'editor2@example.com', role: 'editor' },
|
||||
{ email: 'editor3@example.com', role: 'editor' },
|
||||
{ email: 'editor4@example.com', role: 'editor' },
|
||||
];
|
||||
|
||||
return (
|
||||
<div className="flex h-full w-full flex-col gap-8 px-6 py-4">
|
||||
<div className="flex items-center justify-center">
|
||||
<h1 className="small-title flex grow">{workspaceId ? workspace.name : ''}</h1>
|
||||
<div className="flex flex-col">
|
||||
<div className="flex gap-3">
|
||||
{workspaceId ? (
|
||||
<Dialog>
|
||||
<DialogTrigger asChild>
|
||||
<Button variant="outline">
|
||||
<div className="body flex items-center gap-2">
|
||||
<Users size={16} />
|
||||
<span>멤버 관리</span>
|
||||
</div>
|
||||
</Button>
|
||||
</DialogTrigger>
|
||||
<DialogContent className="lg:max-w-xl">
|
||||
<DialogHeader title="멤버 관리" />
|
||||
<MemberManageForm
|
||||
onSubmit={(data) => {
|
||||
console.log(data);
|
||||
}}
|
||||
members={members}
|
||||
/>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
) : (
|
||||
<></>
|
||||
)}
|
||||
<Dialog>
|
||||
<DialogTrigger asChild>
|
||||
<Button
|
||||
|
Loading…
Reference in New Issue
Block a user