fix: update TableUI padding for better layout and enhance Menu SVG component with forwardRef and memo for performance

This commit is contained in:
faisolavolut 2025-03-13 10:25:14 +07:00
parent 60ff6de9a8
commit e0271ca527
2 changed files with 17 additions and 5 deletions

View File

@ -57,7 +57,7 @@ export const TableUI = <T extends object>({
} }
return ( return (
<div className="flex flex-col flex-grow"> <div className="flex flex-col flex-grow">
<div className="w-full p-4 py-6 pr-6 pl-3 "> <div className="w-full p-4 md:py-6 pr-6 pl-3 ">
<div className="flex flex-row text-2xl font-bold">{title}</div> <div className="flex flex-row text-2xl font-bold">{title}</div>
{breadcrumb?.length ? ( {breadcrumb?.length ? (
<BreadcrumbBetterLink data={breadcrumb} /> <BreadcrumbBetterLink data={breadcrumb} />

View File

@ -1,6 +1,16 @@
import { SVGProps } from "react"; import { SVGProps, Ref, forwardRef, memo } from "react";
const SvgComponent = (props: SVGProps<SVGSVGElement>) => ( import { cn } from "../utils";
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" {...props}> const SvgComponent = (
props: SVGProps<SVGSVGElement>,
ref: Ref<SVGSVGElement>
) => (
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
ref={ref}
className={cn(`text-current`, props.className)}
{...props}
>
<path <path
fill="none" fill="none"
stroke="currentColor" stroke="currentColor"
@ -12,4 +22,6 @@ const SvgComponent = (props: SVGProps<SVGSVGElement>) => (
/> />
</svg> </svg>
); );
export { SvgComponent as Menu }; const ForwardRef = forwardRef(SvgComponent);
const Memo = memo(ForwardRef);
export { Memo as Menu };