How does a quota affect consumer surplus, producer surplus, and total surplus?

Consumer surplus and producer surplus both are influenced to the greatest extent as the provision of quota. A quota in terms of economical terms is a type of barrier or restriction imposed on the total quantity of goods produced and allowed to enter in any nation.The quota if allowed to accessed then the net effect after the import and export of quantity produced or allowed to any country as quota limit is combination of the overall gain to the actual foreign suppliers instead government has suffered loss as well as consumer surplus and producer surplus in any country who is imported from another nation. How does a quota affect consumer surplus, producer surplus, and total surplus?