<script module lang="ts">
	import { defineMeta } from "@storybook/addon-svelte-csf";
	import User from "./User.svelte";

	const { Story } = defineMeta({
		title: "UI/User",
		component: User,
		tags: ["autodocs"],
		argTypes: {
			handle: { control: "text" },
			src: { control: "text" },
			size: {
				control: { type: "inline-radio" },
				options: ["sm", "md", "lg"]
			},
			showImage: { control: "boolean" },
			showText: { control: "boolean" }
		},
		args: {
			handle: "user.tld",
			size: "md",
			showImage: true,
			showText: true
		}
	});
</script>

<Story name="Default" />
<Story name="With avatar" args={{ src: "https://avatars.githubusercontent.com/u/1" }} />
<Story name="Image only" args={{ showText: false }} />
<Story name="Text only" args={{ showImage: false }} />

<Story name="Sizes">
	<div class="flex flex-col items-start gap-3">
		<User size="lg" />
		<User size="md" />
		<User size="sm" />
	</div>
</Story>
