+ {typeof errorComponent === "function"
+ ? errorComponent(error)
+ : errorComponent || (
+
+
Error loading {doctype}
+
{error?.message}
+
+
+ )}
+
+ );
+ }
+
+ const rows = data?.data || [];
+
+ // Default table options
+ const defaultOptions: ListOptionsProps = {
+ options: {
+ selectable: true,
+ },
+ };
+
+ const mergedOptions = {
+ ...defaultOptions,
+ ...options,
+ };
+
+ // Handle empty state
+ if (rows.length === 0) {
+ // If custom empty component provided, render it
+ if (emptyComponent) {
+ return (
+