feat: more fluent

This commit is contained in:
tzhangchi
2023-01-06 00:48:09 +08:00
parent dd149474d9
commit 8ebed0b92e
3 changed files with 33 additions and 9 deletions
@@ -4,16 +4,19 @@ import { Button } from '@/ui/button';
import { useState } from 'react';
import { createWorkspace } from '@/hooks/mock-data/mock';
import Input from '@/ui/input';
interface ICloseParams {
workspaceId?: string;
}
interface ModalProps {
open: boolean;
onClose: () => void;
onClose: (opts?: ICloseParams) => void;
}
export const CreateWorkspaceModal = ({ open, onClose }: ModalProps) => {
const [workspaceName, setWorkspaceName] = useState('');
const handleCreateWorkspace = () => {
createWorkspace(workspaceName);
onClose();
const { workspaceId } = createWorkspace(workspaceName);
onClose({ workspaceId });
};
return (
<div>