Initial commit: backend, storefront, vendor-panel added
This commit is contained in:
1
vendor-panel/src/components/common/thumbnail/index.ts
Normal file
1
vendor-panel/src/components/common/thumbnail/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export * from "./thumbnail"
|
||||
33
vendor-panel/src/components/common/thumbnail/thumbnail.tsx
Normal file
33
vendor-panel/src/components/common/thumbnail/thumbnail.tsx
Normal file
@@ -0,0 +1,33 @@
|
||||
import { Photo } from "@medusajs/icons"
|
||||
import { clx } from "@medusajs/ui"
|
||||
|
||||
type ThumbnailProps = {
|
||||
src?: string | null
|
||||
alt?: string
|
||||
size?: "small" | "base" | "large"
|
||||
}
|
||||
|
||||
export const Thumbnail = ({ src, alt, size = "base" }: ThumbnailProps) => {
|
||||
return (
|
||||
<div
|
||||
className={clx(
|
||||
"bg-ui-bg-component border-ui-border-base flex items-center justify-center overflow-hidden rounded border",
|
||||
{
|
||||
"h-8 w-6": size === "base",
|
||||
"h-5 w-4": size === "small",
|
||||
"h-12 w-12": size === "large",
|
||||
}
|
||||
)}
|
||||
>
|
||||
{src ? (
|
||||
<img
|
||||
src={src}
|
||||
alt={alt}
|
||||
className="h-full w-full object-cover object-center"
|
||||
/>
|
||||
) : (
|
||||
<Photo className="text-ui-fg-subtle" />
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user