import { FormEvent, useState } from "react"; // types import { TPage } from "@plane/types"; // ui import { Button, Input, Tooltip } from "@plane/ui"; // constants import { PAGE_ACCESS_SPECIFIERS } from "@/constants/page"; // helpers import { cn } from "@/helpers/common.helper"; // hooks import { usePlatformOS } from "@/hooks/use-platform-os"; type Props = { formData: Partial; handleFormData: (key: T, value: TPage[T]) => void; handleModalClose: () => void; handleFormSubmit: () => Promise; }; export const PageForm: React.FC = (props) => { const { formData, handleFormData, handleModalClose, handleFormSubmit } = props; // hooks const { isMobile } = usePlatformOS(); // state const [isSubmitting, setIsSubmitting] = useState(false); const handlePageFormSubmit = async (e: FormEvent) => { e.preventDefault(); try { setIsSubmitting(true); await handleFormSubmit(); setIsSubmitting(false); } catch { setIsSubmitting(false); } }; return (

Create Page

Name
Max length of the name should be less than 255 characters
handleFormData("name", e.target.value)} placeholder="Title" className="w-full resize-none text-lg" tabIndex={1} required maxLength={255} />
{PAGE_ACCESS_SPECIFIERS.map((access, index) => ( ))}
{PAGE_ACCESS_SPECIFIERS.find((access) => access.key === formData.access)?.label}
); };