import { ExclamationCircle, MagnifyingGlass, PlusMini } from "@medusajs/icons"
import { Button, Text, clx } from "@medusajs/ui"
import React from "react"
import { useTranslation } from "react-i18next"
import { Link } from "react-router-dom"
export type NoResultsProps = {
title?: string
message?: string
className?: string
}
export const NoResults = ({ title, message, className }: NoResultsProps) => {
const { t } = useTranslation()
return (
{title ?? t("general.noResultsTitle")}
{message ?? t("general.noResultsMessage")}
)
}
type ActionProps = {
action?: {
to: string
label: string
}
}
type NoRecordsProps = {
title?: string
message?: string
className?: string
buttonVariant?: string
icon?: React.ReactNode
} & ActionProps
const DefaultButton = ({ action }: ActionProps) =>
action && (
)
const TransparentIconLeftButton = ({ action }: ActionProps) =>
action && (
)
export const NoRecords = ({
title,
message,
action,
className,
buttonVariant = "default",
icon = ,
}: NoRecordsProps) => {
const { t } = useTranslation()
return (
{icon}
{title ?? t("general.noRecordsTitle")}
{message ?? t("general.noRecordsMessage")}
{buttonVariant === "default" &&
}
{buttonVariant === "transparentIconLeft" && (
)}
)
}