import { useRouter } from 'next/router' import { Link } from 'components/Link' import { Notice } from './Notice' import { useTranslation } from 'components/hooks/useTranslation' import { FieldT } from './types' type Props = { fields: FieldT[] } export function Table({ fields }: Props) { const { locale } = useRouter() const { t } = useTranslation('products') const tableName = t('graphql.reference.name') const tableDescription = t('graphql.reference.description') return ( {fields.map((field) => ( ))}
{tableName} {tableDescription}

{field.name} ( {field.type} )

{field.description ? ( ) : ( 'N/A' )} {field.defaultValue !== undefined && (

The default value is {field.defaultValue.toString()}.

)} {field.preview && } {field.isDeprecated && } {field.arguments && (

{t('graphql.reference.arguments')}

{field.arguments.map((argument, index) => (
  • {argument.name} ( {argument.type.name} )

    { } {argument.defaultValue !== undefined && (

    The default value is {argument.defaultValue.toString()}.

    )}
))}
)}
) }