/* @aztlan/generator-front 3.1.2 */
import {
  Meta, StoryObj,
} from '@storybook/react'
import { graphql } from 'react-relay'
import Component from './Profile.js'
// import * as decorators from "story-utils/decorators.js";

const meta: Meta<typeof Component> = {
  title     :'pages/Profile',
  component :Component,
  // decorators:[decorators.components.Intl],
  parameters:{ layout: 'fullscreen' },
}

const FRAGMENT = graphql`
  fragment ProfileFragment on UserNode {
    firstName
    lastName
    created
    updated
    email
    profilePicture
  }
`

export default meta

const relay = {
  query:graphql`
    query ProfileQuery {
      viewer {
        ...ProfileFragment
      }
    }
  `,
  getReferenceEntry:(data) => [
    'data',
    data.viewer,
  ],
  mockResolvers:{
    UserNode:() => ({
      firstName     :'John',
      lastName      :'Doe',
      created       :'2021-01-01T00:00:00Z',
      updated       :'2021-01-01T00:00:00Z',
      email         :'testemail@something.com',
      profilePicture:'test.jpg',
    }),
  },
}

export const Base: StoryObj<typeof Component> = {
  args:{
    FRAGMENT,
    mock:true,
  },
  parameters:{ relay },
}
