<script lang="ts">
  import {removeUndefined} from "@welshman/lib"
  import {Profiles} from "@welshman/app"
  import {app} from "@app/welshman"
  import ContentMinimal from "@app/components/ContentMinimal.svelte"

  export type Props = {
    pubkey: string
    url?: string
  }

  const {pubkey, url}: Props = $props()

  const profile = app.use(Profiles).one(pubkey, removeUndefined([url]))
</script>

{#if $profile}
  <ContentMinimal event={{content: $profile.about() || "", tags: []}} />
{/if}
