upend/webui/src/stories/UpEntry.stories.ts

48 lines
1.0 KiB
TypeScript

import type { Meta, StoryObj } from '@storybook/svelte';
import { UpEntry, UpListing } from '@upnd/upend';
import { entryAddress, videoAddress } from './common';
import NarrowDecorator from './NarrowDecorator.svelte';
import UpEntryComponent from '../lib/components/display/UpEntry.svelte';
const entry = new UpEntry(
entryAddress,
{
entity: videoAddress,
attribute: 'ATTRIBUTE_PERHAPS_LONG',
value: { t: 'String', c: 'This Is A Video' },
provenance: 'MOCK',
timestamp: new Date().toISOString()
},
new UpListing({})
);
const meta: Meta<UpEntryComponent> = {
title: 'Display/UpEntry',
component: UpEntryComponent,
tags: ['autodocs'],
args: {
entry
},
argTypes: {
address: {
defaultValue: entry,
name: 'Entry'
},
onResolved: {
action: 'resolved'
}
}
};
export default meta;
type Story = StoryObj<UpEntryComponent>;
export const Default: Story = {};
export const Overflow: Story = {
args: {
labels: ['qwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnm'.repeat(3)]
},
decorators: [() => NarrowDecorator as any]
};