import { setProjectAnnotations } from '@storybook/react-vite'

import { afterEach, beforeEach } from 'vitest'

import * as projectAnnotations from './preview'

// This is an important step to apply the right configuration when testing your stories.
// More info at: https://storybook.js.org/docs/api/portable-stories/portable-stories-vitest#setprojectannotations
setProjectAnnotations([projectAnnotations])

beforeEach(async () => {
  // Setup code if needed
})

afterEach(async () => {
  // Ensure proper cleanup
  await new Promise((resolve) => setTimeout(resolve, 100))
})
