2024-08-15 21:30:55 +00:00
|
|
|
<script lang="ts">
|
2024-08-16 17:50:38 +00:00
|
|
|
import cx from "classnames"
|
2024-08-15 21:30:55 +00:00
|
|
|
import Icon from "@lib/components/Icon.svelte"
|
|
|
|
|
|
|
|
|
|
export let src
|
2024-08-23 20:33:36 +00:00
|
|
|
export let alt = ""
|
2024-08-15 21:30:55 +00:00
|
|
|
export let size = 7
|
2024-08-23 20:33:36 +00:00
|
|
|
export let icon = "user-rounded"
|
2024-08-15 21:30:55 +00:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<div
|
2024-09-24 23:30:32 +00:00
|
|
|
class={cx($$props.class, "!flex overflow-hidden rounded-full")}
|
|
|
|
|
class:center={!src}
|
|
|
|
|
style={`width: ${size * 4}px; height: ${size * 4}px; min-width: ${size * 4}px;`}>
|
2024-08-15 21:30:55 +00:00
|
|
|
{#if src}
|
2024-08-23 20:33:36 +00:00
|
|
|
<img {alt} {src} />
|
2024-08-15 21:30:55 +00:00
|
|
|
{:else}
|
2024-08-23 20:33:36 +00:00
|
|
|
<Icon {icon} size={Math.round(size * 0.7)} />
|
2024-08-15 21:30:55 +00:00
|
|
|
{/if}
|
|
|
|
|
</div>
|