import { ElementType } from "react";
import { Button } from "../atoms";

export type EmptyProps = {
  title: string;
  description: string;
  href?: string;
  backText?: string;
  Link: ElementType
};
export default function Empty({
  title = "Not Found",
  description = "Could not find requested resource",
  href = "/",
  backText = "Go Back<",
  Link
}: EmptyProps) {
  return (
    <div className="fl-bg-light fl-p-8 fl-rounded-md fl-flex fl-flex-col fl-space-y-2">
      <h2 className="fl-text-xl fl-font-semibold">{title}</h2>
      <p className="fl-text-black/75 fl-pb-4">{description}</p>
      {href && (
        <Link href={href}>
          <Button>{backText}</Button>
        </Link>
      )}
    </div>
  );
}
