From f3ce4ca0907b594cc38e7407aac9d1151a84b014 Mon Sep 17 00:00:00 2001 From: Nathan Seva <thykof@protonmail.ch> Date: Mon, 26 Feb 2024 10:54:37 +0100 Subject: [PATCH] Update src/components/Spinner/Spinner.tsx MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Thomas Sénéchal <44696378+thomas-senechal@users.noreply.github.com> --- src/components/Spinner/Spinner.tsx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/components/Spinner/Spinner.tsx b/src/components/Spinner/Spinner.tsx index 792f22d5..7ca0a46e 100644 --- a/src/components/Spinner/Spinner.tsx +++ b/src/components/Spinner/Spinner.tsx @@ -11,13 +11,13 @@ interface SpinnerProps { export function Spinner(props: SpinnerProps) { const { customClass = '', size = 'sm', color = 'neutral' } = props; - const isSmall = size === 'sm'; - const isMedium = size === 'md'; - const sizeClass = isSmall - ? 'w-6 h-6' - : isMedium - ? 'w-8 h-8' - : 'w-12 h-12 border-4'; +const sizeToClass = { + sm: 'w-6 h-6', + md: 'w-8 h-8', + lg: 'w-12 h-12 border-4', +}; + +const sizeClass = sizeToClass[size] || sizeToClass['lg']; return ( <div