add parts data

This commit is contained in:
Kurt Hutten
2020-10-11 19:41:48 +11:00
parent f1dc6c28e4
commit b3456860d2
34 changed files with 1146 additions and 11 deletions

View File

@@ -0,0 +1,33 @@
import { Link, routes } from '@redwoodjs/router'
import Parts from 'src/components/Parts'
export const QUERY = gql`
query PARTS {
parts {
id
title
description
code
mainImage
createdAt
}
}
`
export const Loading = () => <div>Loading...</div>
export const Empty = () => {
return (
<div className="rw-text-center">
{'No parts yet. '}
<Link to={routes.newPart()} className="rw-link">
{'Create one?'}
</Link>
</div>
)
}
export const Success = ({ parts }) => {
return <Parts parts={parts} />
}