MCPcopy Create free account
hub / github.com/SplootCode/splootcode / ProjectCard

Function ProjectCard

src/pages/user_home.tsx:31–75  ·  view source on GitHub ↗
(props: {
  ownerID: string
  projectID: string
  title: string
  description: string
  runType: RunType
  onDelete: () => void
})

Source from the content-addressed store, hash-verified

29}
30
31const ProjectCard = (props: {
32 ownerID: string
33 projectID: string
34 title: string
35 description: string
36 runType: RunType
37 onDelete: () => void
38}) => {
39 const { ownerID, projectID, title, description, onDelete, runType } = props
40 return (
41 <Flex borderWidth="1px" borderRadius="md" bg="gray.800" borderColor="gray.500" alignItems={'center'}>
42 <HStack px={2} py={1} alignItems={'center'} as={Link} to={`/p/${ownerID}/${projectID}`} flexGrow={1}>
43 <RunTypeIcon runType={runType} />
44 <Box py={2} px={2} flexDirection="row">
45 <Heading as="h4" size="sm">
46 {title}
47 </Heading>
48 {description ? (
49 <Text lineHeight={1.2} color={'gray.300'}>
50 {description}
51 </Text>
52 ) : null}
53 </Box>
54 </HStack>
55 <Spacer />
56 <IconButton
57 size="sm"
58 aria-label="Delete project"
59 variant={'ghost'}
60 mx={1}
61 color={'gray.500'}
62 icon={<DeleteIcon />}
63 onClick={(event) => {
64 event.stopPropagation()
65 event.preventDefault()
66 const result = window.confirm(`Are you sure you want to delete ${title}?`)
67 if (result) {
68 onDelete()
69 }
70 return false
71 }}
72 ></IconButton>
73 </Flex>
74 )
75}
76
77export const UserHomePage = (props: UserHomePageProps) => {
78 const history = useHistory()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected