diff --git a/packages/web/components/templates/integrations/Readwise.tsx b/packages/web/components/templates/integrations/Readwise.tsx new file mode 100644 index 000000000..7575be6f9 --- /dev/null +++ b/packages/web/components/templates/integrations/Readwise.tsx @@ -0,0 +1,63 @@ +import { SpanBox, VStack } from '../../elements/LayoutPrimitives' +import { Button } from '../../elements/Button' +import { StyledText } from '../../elements/StyledText' +import { useCallback, useEffect, useState } from 'react' +import { FormInput } from '../../elements/FormElements' +import { styled } from '@stitches/react' +import { setIntegrationMutation } from '../../../lib/networking/mutations/setIntegrationMutation' + +const BorderedFormInput = styled(FormInput, { + height: '40px', + paddingLeft: '6px', + borderRadius: '6px', + background: 'white', + color: '$omnivoreGray', + border: `1px solid 1px solid rgba(0, 0, 0, 0.06)`, +}) + +const FormLabel = styled('label', { + fontSize: '16px', + color: '$omnivoreGray', +}) + +export function Readwise(): JSX.Element { + const [token, setToken] = useState('') + const [errorMessage, setErrorMessage] = useState(undefined) + + const setReadwiseToken = useCallback(() => { + setIntegrationMutation({ + token, + type: 'READWISE', + enabled: true, + }) + console.log("SETTING READWISE TOKEN", token) + }, [token]) + + return ( + + + + + Enter your Readwise API token. You can get your token + {' '} + here. + + { e.preventDefault(); setToken(e.target.value); }} + /> + + + + {errorMessage && ( + {errorMessage} + )} + + + ) +}