- {menuEntries.map(([menuName, quantity], index) => {
- // 화면 크기에 따른 글자 수 제한
- const getDisplayText = (text: string) => {
- // xl: 전체 표시, lg: 12글자, md: 7글자, sm: 6글자, xs: 4글자
- if (windowWidth >= 1280) {
- return text; // 전체 화면에서는 모든 글자 표시
- } else if (windowWidth >= 1024) {
- return text.length > 12 ? `${text.slice(0, 12)}...` : text;
- } else if (windowWidth >= 768) {
- return text.length > 7 ? `${text.slice(0, 7)}...` : text;
- } else if (windowWidth >= 640) {
- return text.length > 6 ? `${text.slice(0, 6)}...` : text;
- } else {
- return text.length > 4 ? `${text.slice(0, 4)}...` : text;
- }
- };
-
- const isLargeScreen = windowWidth >= 1280;
-
- return (
-
-
- {getDisplayText(menuName)}
-
-
- {quantity}
-
+
+ {menuEntries.map(([menuName, quantity], index) => (
+
+
{menuName}
+
{quantity}
- );
- })}
+ ))}
+
-