import { MemoryRouter, Route, createMemoryHistory } from '@solidjs/router';
import type { Meta, StoryObj } from 'storybook-solidjs-vite';

import '../app.css';
import AdminHomePage from '../routes/admin';

const meta = {
  title: 'Admin/Dashboard',
  parameters: {
    layout: 'fullscreen',
  },
} satisfies Meta;

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

export const Default: Story = {
  render: () => {
    const history = createMemoryHistory();
    history.set({ value: '/admin', replace: true, scroll: false });
    return (
    <MemoryRouter history={history}>
      <Route path="/admin" component={AdminHomePage} />
    </MemoryRouter>
    );
  },
};
