Fix style format and optimzed code

This commit is contained in:
2023-10-30 21:10:09 +07:00
parent c775d6e581
commit ea1a13da6e
5 changed files with 22 additions and 17 deletions
+2 -2
View File
@@ -41,7 +41,7 @@ interface IFilterProps {
}[];
}
function OrderBy({ options }: IFilterProps) {
const OrderBy = ({ options }: IFilterProps) => {
const field = 'orderBy';
const [searchParams, setSearchParams] = useSearchParams();
@@ -67,6 +67,6 @@ function OrderBy({ options }: IFilterProps) {
))}
</StyledFilter>
);
}
};
export default OrderBy;
+2 -2
View File
@@ -17,7 +17,7 @@ const StyledSelect = styled.select`
font-weight: 500;
`;
function Select({ options, value, onChange }: ISelect) {
const Select = ({ options, value, onChange }: ISelect) => {
return (
<StyledSelect value={value} onChange={onChange}>
{options.map((option) => (
@@ -27,6 +27,6 @@ function Select({ options, value, onChange }: ISelect) {
))}
</StyledSelect>
);
}
};
export default Select;
@@ -1,4 +1,4 @@
import { ReactNode, memo, useContext } from 'react';
import { ReactNode, useContext } from 'react';
// Components
import { StyledBody, StyledHeader, StyledRow, StyledTable } from './styled';
@@ -19,10 +19,10 @@ const Table = ({ columns, children }: ITable) => {
);
};
const Header = memo(({ children }: ITable) => {
const Header = ({ children }: ITable) => {
const columns = useContext(TableContext);
return <StyledHeader columns={columns}>{children}</StyledHeader>;
});
};
const Body = <T,>({ data, render }: ITableBody<T>) => {
return (