Social handles CRUD (admin side, nothing user-facing)
This commit is contained in:
40
web/src/components/Social/SocialCell/SocialCell.tsx
Normal file
40
web/src/components/Social/SocialCell/SocialCell.tsx
Normal file
@@ -0,0 +1,40 @@
|
||||
import type { FindSocialById, FindSocialByIdVariables } from 'types/graphql'
|
||||
|
||||
import type {
|
||||
CellSuccessProps,
|
||||
CellFailureProps,
|
||||
TypedDocumentNode,
|
||||
} from '@redwoodjs/web'
|
||||
|
||||
import CellEmpty from 'src/components/Cell/CellEmpty/CellEmpty'
|
||||
import CellFailure from 'src/components/Cell/CellFailure/CellFailure'
|
||||
import CellLoading from 'src/components/Cell/CellLoading/CellLoading'
|
||||
import Social from 'src/components/Social/Social'
|
||||
|
||||
export const QUERY: TypedDocumentNode<
|
||||
FindSocialById,
|
||||
FindSocialByIdVariables
|
||||
> = gql`
|
||||
query FindSocialById($id: Int!) {
|
||||
social: social(id: $id) {
|
||||
id
|
||||
name
|
||||
type
|
||||
username
|
||||
}
|
||||
}
|
||||
`
|
||||
|
||||
export const Loading = () => <CellLoading />
|
||||
|
||||
export const Empty = () => <CellEmpty />
|
||||
|
||||
export const Failure = ({
|
||||
error,
|
||||
}: CellFailureProps<FindSocialByIdVariables>) => <CellFailure error={error} />
|
||||
|
||||
export const Success = ({
|
||||
social,
|
||||
}: CellSuccessProps<FindSocialById, FindSocialByIdVariables>) => {
|
||||
return <Social social={social} />
|
||||
}
|
||||
Reference in New Issue
Block a user