Some checks failed
build-docker-imge / Build the docker container (push) Failing after 1m25s
52 lines
1.2 KiB
TypeScript
52 lines
1.2 KiB
TypeScript
import type {
|
|
FindNachhilfeangebots,
|
|
FindNachhilfeangebotsVariables,
|
|
} from 'types/graphql'
|
|
|
|
import { Link, routes } from '@redwoodjs/router'
|
|
import type {
|
|
CellSuccessProps,
|
|
CellFailureProps,
|
|
TypedDocumentNode,
|
|
} from '@redwoodjs/web'
|
|
|
|
import Nachhilfeangebots from 'src/components/Nachhilfeangebot/Nachhilfeangebots'
|
|
|
|
export const QUERY: TypedDocumentNode<
|
|
FindNachhilfeangebots,
|
|
FindNachhilfeangebotsVariables
|
|
> = gql`
|
|
query FindNachhilfeangebots {
|
|
nachhilfeangebots {
|
|
id
|
|
subject
|
|
currentClass
|
|
cost
|
|
userId
|
|
}
|
|
}
|
|
`
|
|
|
|
export const Loading = () => <div>Loading...</div>
|
|
|
|
export const Empty = () => {
|
|
return (
|
|
<div className="rw-text-center">
|
|
No nachhilfeangebots yet.{' '}
|
|
<Link to={routes.newNachhilfeangebot()} className="rw-link">
|
|
Create one?
|
|
</Link>
|
|
</div>
|
|
)
|
|
}
|
|
|
|
export const Failure = ({ error }: CellFailureProps<FindNachhilfeangebots>) => (
|
|
<div className="rw-cell-error">{error?.message}</div>
|
|
)
|
|
|
|
export const Success = ({
|
|
nachhilfeangebots,
|
|
}: CellSuccessProps<FindNachhilfeangebots, FindNachhilfeangebotsVariables>) => {
|
|
return <Nachhilfeangebots nachhilfeangebots={nachhilfeangebots} />
|
|
}
|