/** * CreateWorkspaceForm Component * Form for creating new workspace with preview */ import React, { useState } from 'react' import { Button, TextField } from '../fakemui' import { AddIcon } from '../../icons/react' import styles from '../../scss/components/forms/create-workspace-form.module.scss' const WORKSPACE_COLORS = [ '#6750A4', '#625B71', '#7D5260', '#BA1A1A', '#006E1C', '#00639B', '#A8541D', '#5C5C5C', ] interface CreateWorkspaceFormProps { name: string onNameChange: (name: string) => void onSubmit: (e: React.FormEvent) => void onCancel: () => void [key: string]: any } /** * CreateWorkspaceForm - Workspace creation with live preview */ export const CreateWorkspaceForm = ({ name, onNameChange, onSubmit, onCancel, ...rest }: CreateWorkspaceFormProps) => { const [color, setColor] = useState(WORKSPACE_COLORS[0]) const [description, setDescription] = useState('') const initials = name.trim() ? name.split(' ').map((w) => w[0]).join('').slice(0, 2).toUpperCase() : 'WS' return (
{initials}

{name || 'Workspace Name'}

{description || 'No description'}

{WORKSPACE_COLORS.map((c) => (

Create New Workspace

onNameChange(e.target.value)} autoFocus />