import type { Meta, StoryObj } from '@storybook/react';
import { FormattedDocument } from './FormattedDocument';
import React from 'react';

const meta: Meta<typeof FormattedDocument> = {
  title: 'Assistant/FormattedDocument',
  component: FormattedDocument,
  argTypes: {
    maxPreviewLength: { control: 'number' },
  },
};

export default meta;
type Story = StoryObj<typeof FormattedDocument>;

const longContent = `# Strategic Project Proposal
## Overview
This proposal describes the implementation of a generative artificial intelligence layer across the entire customer journey.

### Key Objectives
- Reduce service latency by up to 40%
- Increase qualified lead conversion rate
- Automate weekly management reports

### Roadmap
1. **Week 1-2:** Discovery and Data Mapping
2. **Week 3-4:** Infrastructure and Agent Setup
3. **Week 5-8:** Pilot Implementation and Feedback Loop

## Technical Details
The architecture is based on RAG (Retrieval Augmented Generation) using high-performance vector databases. Agents are orchestrated in real-time to ensure accurate and contextual responses.

- [x] Persona definition
- [x] Guardrails configuration
- [ ] CRM integration
- [ ] Global deployment

---
**Note:** This is a preliminary version for board review.`;

export const Default: Story = {
  args: {
    content: longContent,
    maxPreviewLength: 200,
  },
  render: args => (
    <div className="w-full max-w-xl p-6 border rounded-xl bg-card">
      <FormattedDocument {...args} />
    </div>
  ),
};
