// Context
import { LoadingStatusContext } from '@freesewing/react/context/LoadingStatus'
// Hooks
import React, { useState, useContext } from 'react'
import { useAccount } from '@freesewing/react/hooks/useAccount'
import { useBackend } from '@freesewing/react/hooks/useBackend'
// Components
import { SaveIcon } from '@freesewing/react/components/Icon'
import { StringInput } from '@freesewing/react/components/Input'
const labels = {
instagram: 'Instagram',
mastodon: 'Mastodon',
reddit: 'Reddit',
twitch: 'Twitch',
tiktok: 'TikTok',
website: 'Website',
}
export const Instagram = () =>
Not a supported platform
// Helper method to save changes const save = async () => { setLoadingStatus([true, 'Saving linked identity']) const data = { data: {} } data.data[platform] = platformId const [status, body] = await backend.updateAccount(data) if (status === 200 && body.result === 'success') { setAccount(body.account) setLoadingStatus([true, `Saved your ${labels[platform]} info`, true, true]) } else setLoadingStatus([true, 'Something went wrong. Please report this', true, true]) } return (