import { useState, useEffect } from 'react'
import { useBackend } from 'shared/hooks/use-backend.mjs'
import { useTranslation } from 'next-i18next'
import { cloudflareImageUrl } from 'shared/utils.mjs'
import { Loading } from 'shared/components/spinner.mjs'
import { Popout } from 'shared/components/popout/index.mjs'
import { Mdx } from 'shared/components/mdx/dynamic.mjs'
export const Author = ({ author = '' }) => {
const { t } = useTranslation(['posts'])
const backend = useBackend()
const [profile, setProfile] = useState(null)
useEffect(() => {
const loadAuthor = async () => {
const result = await backend.getProfile(author)
if (result.success && result.data.profile) setProfile(result.data.profile)
else setProfile(false)
}
if (!profile) loadAuthor()
}, [author])
if (profile === null) return
This is a known issue that I decided not to block the v3 release for. I will take care of
this later.
If you are the author of this post, you can reach out so I can correctly attribute it.
We cannot link authors/makers to their FreeSewing accounts (yet)