import { toast } from '@/hooks/use-toast';

/**
 * Standardized toast notifications for form submissions
 * Provides consistent success/error feedback across all forms
 */
export const formToasts = {
  success: {
    create: (entityType: string, entityName?: string) => {
      toast({
        title: '✓ Submission Created',
        description: entityName 
          ? `${entityName} has been submitted for review.`
          : `${entityType} has been submitted for review.`,
        variant: 'default',
      });
    },
    
    update: (entityType: string, entityName?: string) => {
      toast({
        title: '✓ Update Submitted',
        description: entityName
          ? `Changes to ${entityName} have been submitted for review.`
          : `${entityType} update has been submitted for review.`,
        variant: 'default',
      });
    },
    
    moderatorApproval: (entityType: string, entityName?: string) => {
      toast({
        title: '✓ Published Successfully',
        description: entityName
          ? `${entityName} is now live on the site.`
          : `${entityType} is now live on the site.`,
        variant: 'default',
      });
    },
  },
  
  error: {
    validation: (fieldCount: number) => {
      toast({
        title: 'Validation Failed',
        description: `Please fix ${fieldCount} error${fieldCount > 1 ? 's' : ''} before submitting.`,
        variant: 'destructive',
      });
    },
    
    network: () => {
      toast({
        title: 'Connection Error',
        description: 'Unable to submit. Please check your connection and try again.',
        variant: 'destructive',
      });
    },
    
    generic: (error: string) => {
      toast({
        title: 'Submission Failed',
        description: error,
        variant: 'destructive',
      });
    },
  },
};