Skip to content

Next.js Image import in @liam-hq/erd-core package #3246

@tnyo43

Description

@tnyo43

Task description

In #3243, I added a feature to import images (,png) and videos (.mp4) in @liam-hq/erd-core. Since the package is referred by bothe Next.js and Vite CLI apps, it needs to support the both framework/build tool.

Background

Now it works with a simple condition check logic. But I hope we could fine a better way to resolve this.

const getImageSrc = (imageSrc: string | StaticImageData) =>
typeof imageSrc === 'string' ? imageSrc : imageSrc.src

I think the approach we should take will also depend on how images will be used in the @liam-hq/erd-core and the other packages in the future. Before discussing the implementation, I’d like to first consider what kinds of use cases are likely to arise.

TODO (Optional)

  • [ ]
  • [ ]
  • [ ]

Additional notes (Optional)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions