import * as React from "react";
import { cn } from "@/lib/utils";

/** Consistent panel table shell: rounded-2xl card, bordered toolbar, no heavy shadow. */
export function TableCard({
  toolbar,
  children,
  footer,
  className,
}: {
  toolbar?: React.ReactNode;
  children: React.ReactNode;
  footer?: React.ReactNode;
  className?: string;
}) {
  return (
    <div className={cn("overflow-hidden rounded-2xl border bg-card shadow-sm", className)}>
      {toolbar ? (
        <div className="flex flex-col gap-3 border-b px-4 py-3 lg:flex-row lg:items-center lg:justify-between">
          {toolbar}
        </div>
      ) : null}
      {children}
      {footer}
    </div>
  );
}

export default TableCard;
