2023-11-08 08:21:55 +00:00
import { observer } from "mobx-react-lite" ;
2023-10-30 14:39:04 +00:00
import { PlusIcon } from "lucide-react" ;
2023-12-14 11:56:16 +00:00
// hooks
2023-12-14 12:19:19 +00:00
import { useApplication , useUser } from "hooks/store" ;
2023-10-30 14:39:04 +00:00
// components
2023-11-29 15:02:10 +00:00
import { NewEmptyState } from "components/common/new-empty-state" ;
2023-12-13 17:35:23 +00:00
// constants
2023-12-15 11:31:36 +00:00
import { EUserProjectRoles } from "constants/project" ;
2023-10-30 14:39:04 +00:00
// assets
2023-11-28 13:17:52 +00:00
import emptyIssue from "public/empty-state/empty_issues.webp" ;
2023-12-11 09:06:34 +00:00
import { EProjectStore } from "store_legacy/command-palette.store" ;
2023-10-30 14:39:04 +00:00
2023-11-08 08:21:55 +00:00
export const ProjectEmptyState : React.FC = observer ( ( ) = > {
2023-12-14 11:56:16 +00:00
// store hooks
2023-11-27 08:45:33 +00:00
const {
commandPalette : commandPaletteStore ,
2023-12-14 11:56:16 +00:00
eventTracker : { setTrackElement } ,
} = useApplication ( ) ;
2023-12-14 12:19:19 +00:00
const {
membership : { currentProjectRole } ,
} = useUser ( ) ;
2023-11-08 08:21:55 +00:00
2023-12-15 11:31:36 +00:00
const isEditingAllowed = ! ! currentProjectRole && currentProjectRole >= EUserProjectRoles . MEMBER ;
2023-11-08 08:21:55 +00:00
return (
2023-12-10 10:18:10 +00:00
< div className = "grid h-full w-full place-items-center" >
2023-11-28 13:17:52 +00:00
< NewEmptyState
title = "Create an issue and assign it to someone, even yourself"
2023-12-07 06:29:46 +00:00
description = "Think of issues as jobs, tasks, work, or JTBD. Which we like. An issue and its sub-issues are usually time-based actionables assigned to members of your team. Your team creates, assigns, and completes issues to move your project towards its goal."
2023-11-08 08:21:55 +00:00
image = { emptyIssue }
2023-11-28 13:17:52 +00:00
comicBox = { {
title : "Issues are building blocks in Plane." ,
direction : "left" ,
description :
"Redesign the Plane UI, Rebrand the company, or Launch the new fuel injection system are examples of issues that likely have sub-issues." ,
} }
2023-11-08 08:21:55 +00:00
primaryButton = { {
2023-11-28 13:17:52 +00:00
text : "Create your first issue" ,
2023-11-08 08:21:55 +00:00
icon : < PlusIcon className = "h-3 w-3" strokeWidth = { 2 } / > ,
2023-11-25 15:56:26 +00:00
onClick : ( ) = > {
setTrackElement ( "PROJECT_EMPTY_STATE" ) ;
2023-11-27 08:45:33 +00:00
commandPaletteStore . toggleCreateIssueModal ( true , EProjectStore . PROJECT ) ;
} ,
2023-11-08 08:21:55 +00:00
} }
2023-12-13 17:35:23 +00:00
disabled = { ! isEditingAllowed }
2023-11-08 08:21:55 +00:00
/ >
< / div >
) ;
} ) ;