Files
twenty/packages/twenty-docs/src/components/playground.tsx
martmull ed7bd0ba26 2914 graphql api documentation (#3065)
* Remove dead code

* Create playground component

* Remove useless call to action

* Fix graphiql theme

* Fix style

* Split components

* Move headers to headers form

* Fix nodes in open-api components

* Remove useless check

* Clean code

* Fix css differences

* Keep carret when fetching schema
2023-12-20 12:01:55 +01:00

28 lines
585 B
TypeScript

import React, { useState } from 'react';
import TokenForm, { TokenFormProps } from '../components/token-form';
const Playground = (
{
children,
setOpenApiJson,
setToken
}: Partial<React.PropsWithChildren | TokenFormProps>
) => {
const [isTokenValid, setIsTokenValid] = useState(false)
return (
<>
<TokenForm
setOpenApiJson={setOpenApiJson}
setToken={setToken}
isTokenValid={isTokenValid}
setIsTokenValid={setIsTokenValid}
/>
{
isTokenValid && children
}
</>
)
}
export default Playground;