1
- import { GetServerSidePropsContext } from 'next' ;
2
1
import { useRouter } from 'next/router' ;
3
2
import React , { useEffect , useState } from 'react' ;
4
3
import Layout from '../../components/Layout' ;
5
- import { User } from '../../util/database' ;
6
4
7
- type Props = {
8
- user : User ;
9
- notificationLength ?: number ;
10
- } ;
11
-
12
- const SingleUser = ( props : Props ) => {
5
+ const SingleUser = ( props ) => {
13
6
const router = useRouter ( ) ;
14
7
const [ notificationLength , setNotificationLength ] = useState ( ) ;
15
8
16
- const deleteUser = async ( id : number ) => {
9
+ const deleteUser = async ( id ) => {
17
10
await fetch ( `/api/users/${ id } ` , {
18
11
method : 'DELETE' ,
19
12
headers : { 'Content-Type' : 'application/json' } ,
@@ -25,6 +18,8 @@ const SingleUser = (props: Props) => {
25
18
setNotificationLength ( props . notificationLength ) ;
26
19
} , [ props . notificationLength ] ) ;
27
20
21
+ console . log ( notificationLength ) ;
22
+
28
23
return (
29
24
< Layout notificationLength = { props . notificationLength } >
30
25
< div className = "max-w-7xl mx-auto p-4 md:p-10 text-center" >
@@ -64,7 +59,7 @@ const SingleUser = (props: Props) => {
64
59
65
60
export default SingleUser ;
66
61
67
- export async function getServerSideProps ( context : GetServerSidePropsContext ) {
62
+ export async function getServerSideProps ( context ) {
68
63
const { getUser, getUserBySessionToken, getWantlistbyItemUserId } =
69
64
await import ( '../../util/database' ) ;
70
65
0 commit comments