// Common types used across all microfrontends

export interface BaseEntity {
  id: string;
  created_at: string;
  updated_at: string;
  created_by?: string;
  updated_by?: string;
}

export interface Owner {
  type: 'individual' | 'team';
  name: string;
  owner: string;
}

export interface FormSidebarProps {
  opened: boolean;
  onClose: () => void;
  onSuccess: () => void;
  editItem?: any;
}

export interface ListItem {
  id: string;
  name?: string;
  title?: string;
  email?: string;
  status?: string;
  role?: string;
  type?: string;
  [key: string]: any;
}

export interface ApiResponse<T> {
  data: T;
  message?: string;
  error?: string;
}

export interface PaginatedResponse<T> {
  data: T[];
  total: number;
  page: number;
  limit: number;
  has_more: boolean;
}

export interface FilterOptions {
  search?: string;
  status?: string;
  type?: string;
  role?: string;
  limit?: number;
  offset?: number;
  [key: string]: any;
}

export interface NotificationConfig {
  title: string;
  message: string;
  color: 'red' | 'green' | 'blue' | 'yellow' | 'gray';
  [key: string]: any; // Allow additional properties for Mantine compatibility
}

export interface ValidationRule {
  required?: boolean;
  minLength?: number;
  maxLength?: number;
  pattern?: RegExp;
  email?: boolean;
  url?: boolean;
  custom?: (value: any) => string | null;
}

export interface FormField {
  name: string;
  label: string;
  type: 'text' | 'email' | 'number' | 'select' | 'multiselect' | 'textarea' | 'date' | 'json';
  placeholder?: string;
  description?: string;
  required?: boolean;
  disabled?: boolean;
  options?: Array<{ value: string; label: string }>;
  validation?: ValidationRule;
  defaultValue?: any;
}

// Component-specific types
export type { StatusVariant, StatusBadgeProps } from '../components/StatusBadge/StatusBadge';
export type { EmptyStateVariant, EmptyStateContext, EmptyStateProps, EmptyStateAction } from '../components/EmptyState/EmptyState';
export type { SidebarProps, FormSidebarWrapperProps, DetailsSidebarProps, QuickSidebarProps } from '../components/Sidebar/Sidebar';
export type { ActionMenuItem, ActionMenuProps } from '../components/ActionMenu/ActionMenu';
export type { LoadingVariant, LoadingSize, LoadingStateProps } from '../components/LoadingState/LoadingState';