From 52c8492a7591a735997c923432598cde319e48bd Mon Sep 17 00:00:00 2001 From: Muhammad Zourdy Date: Wed, 27 Jul 2022 14:58:13 +0200 Subject: [PATCH] Refactoring cells component pattern --- src/components/grid/cell/cell.tsx | 42 +++++++++++++------------------ 1 file changed, 18 insertions(+), 24 deletions(-) diff --git a/src/components/grid/cell/cell.tsx b/src/components/grid/cell/cell.tsx index 32cc1897..5ce93198 100644 --- a/src/components/grid/cell/cell.tsx +++ b/src/components/grid/cell/cell.tsx @@ -12,31 +12,25 @@ interface CellsType { export const CellComponent: FunctionComponent = ({ mouseDown, children }) => { switch (children) { case 0: - return ( -
- ); + return ; case 10: - return ( -
- ); + return ; default: - return ( -
- ); + return ; } }; + +const ClosedFrame: FunctionComponent<{ mouseDown: boolean }> = ({ mouseDown }) => { + return ( +
+ ); +}; + +const EmptyFrame: FunctionComponent = () => { + return
; +};