11import React from "react"
22import { makeStyles } from "@material-ui/core/styles"
33import Paper from "@material-ui/core/Paper"
4- import { useRouter } from "next/router"
54import Link from "next/link"
65import { EmptyState } from "../../components"
76import { ErrorSummary } from "../../components/ErrorSummary"
@@ -14,11 +13,10 @@ import { FullScreenLoader } from "../../components/Loader/FullScreenLoader"
1413
1514import { Organization , Project } from "./../../api"
1615import useSWR from "swr"
17- import { CodeExample } from "../../components/CodeExample"
16+ import { CodeExample } from "../../components/CodeExample/CodeExample "
1817
1918const ProjectsPage : React . FC = ( ) => {
2019 const styles = useStyles ( )
21- const router = useRouter ( )
2220 const { me, signOut } = useUser ( true )
2321 const { data : projects , error } = useSWR < Project [ ] | null , Error > ( "/api/v2/projects" )
2422 const { data : orgs , error : orgsError } = useSWR < Organization [ ] , Error > ( "/api/v2/users/me/organizations" )
@@ -35,10 +33,6 @@ const ProjectsPage: React.FC = () => {
3533 return < FullScreenLoader />
3634 }
3735
38- const createProject = ( ) => {
39- void router . push ( "/projects/create" )
40- }
41-
4236 // Create a dictionary of organization ID -> organization Name
4337 // Needed to properly construct links to dive into a project
4438 const orgDictionary = orgs . reduce ( ( acc : Record < string , string > , curr : Organization ) => {
@@ -58,14 +52,14 @@ const ProjectsPage: React.FC = () => {
5852 } ,
5953 ]
6054
61- const description = < div >
62- < div > Run the following command to get started:</ div >
63- < CodeExample code = "coder project create" />
64- </ div >
55+ const description = (
56+ < div >
57+ < div className = { styles . descriptionLabel } > Run the following command to get started:</ div >
58+ < CodeExample code = "coder project create" />
59+ </ div >
60+ )
6561
66- const emptyState = < EmptyState
67- message = "No projects have been created yet"
68- description = { description } />
62+ const emptyState = < EmptyState message = "No projects have been created yet" description = { description } />
6963
7064 const tableProps = {
7165 title : "All Projects" ,
@@ -88,11 +82,14 @@ const ProjectsPage: React.FC = () => {
8882 )
8983}
9084
91- const useStyles = makeStyles ( ( ) => ( {
85+ const useStyles = makeStyles ( ( theme ) => ( {
9286 root : {
9387 display : "flex" ,
9488 flexDirection : "column" ,
9589 } ,
90+ descriptionLabel : {
91+ marginBottom : theme . spacing ( 1 ) ,
92+ } ,
9693} ) )
9794
9895export default ProjectsPage
0 commit comments