import { type Meta, type StoryObj } from '@storybook/react-vite';

import dummyPdf2 from '../../../../static/prueba-texto-largo.pdf';
import dummyPdf from '../../../../static/test-links.pdf';

import { PdfFullScreen } from './components/FullScreen';
import PdfViewer from '.';

const meta: Meta<typeof PdfViewer> = {
  component: PdfViewer,
  title: 'Composed Components/PdfViewer',
  tags: ['autodocs'],
  args: {
    name: 'Nombre del archivo.pdf',
    file: dummyPdf,
  },
};

const fullScreenMetadata: Meta<typeof PdfFullScreen> = {
  component: PdfFullScreen,
  title: 'Composed Components/PdfViewer/FullScreen',
  tags: ['autodocs'],
  args: {
    file: dummyPdf,
  },
};

export default meta;

export { fullScreenMetadata as PdfFullScreenMeta };

type Story = StoryObj<typeof PdfViewer>;
type FullScreenStory = StoryObj<typeof PdfFullScreen>;

export const Default: Story = {
  args: {},
};

export const FloatingVariant: Story = {
  args: {
    variant: 'floating',
    file: dummyPdf2,
  },
};

export const FullScreenWithHeader: Story = {
  args: {
    slotProps: {
      fullscreen: {
        showHeader: true,
      },
    },
  },
};

export const WithoutFullScreenAndRotation: Story = {
  args: {
    slotProps: {
      navbar: {
        showFullScreen: false,
        showRotation: false,
      },
    },
  },
};

export const FullScreenWithFetching: FullScreenStory = {
  args: {
    fileProps: {
      isLoading: false,
    },
  },
};
