Skip to content

Commit 94c030a

Browse files
lumburovskalinaandhreljaKernLennartSchmidtKern
authored
Cellcomponents for integratios (#47)
* Cellcomponents for integratios * Memoized icons * More memoized icons * Recycle icon memoized * perf: add IconCircleCheck * perf: add IconClock --------- Co-authored-by: andhreljaKern <[email protected]> Co-authored-by: LennartSchmidtKern <[email protected]>
1 parent ce8b5a1 commit 94c030a

File tree

3 files changed

+25
-9
lines changed

3 files changed

+25
-9
lines changed

components/kern-icons/icons.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { memo } from 'react';
2-
import { IconActivity, IconAdjustments, IconAdjustmentsAlt, IconAdjustmentsOff, IconAlertCircle, IconAlertTriangle, IconAlertTriangleFilled, IconAngle, IconApi, IconArchive, IconArrowAutofitDown, IconArrowCurveRight, IconArrowDown, IconArrowLeft, IconArrowNarrowLeft, IconArrowNarrowRight, IconArrowRight, IconArrowsRandom, IconArrowsSort, IconArrowUp, IconArrowUpRight, IconAssembly, IconBallpen, IconBallpenOff, IconBell, IconBolt, IconBottle, IconBox, IconBoxOff, IconBrandOpenai, IconBrandPython, IconBulb, IconBulldozer, IconCamera, IconCategoryPlus, IconCell, IconChartBubble, IconChartCircles, IconChartDots3, IconChartLine, IconChartPie, IconCheck, IconChecks, IconChevronCompactLeft, IconChevronCompactRight, IconChevronDown, IconChevronLeft, IconChevronRight, IconChevronUp, IconCircle, IconCircleCheckFilled, IconCircleMinus, IconCirclePlus, IconClick, IconClipboard, IconClipboardCheck, IconClipboardOff, IconCode, IconCodePlus, IconColorPicker, IconColumns, IconColumns1, IconColumns2, IconColumns3, IconCopy, IconCrown, IconCrownOff, IconDatabase, IconDatabasePlus, IconDeviceFloppy, IconDots, IconDotsVertical, IconDownload, IconEdit, IconEngine, IconExclamationCircle, IconExclamationMark, IconExternalLink, IconEye, IconEyeCancel, IconEyeCheck, IconEyeOff, IconFile, IconFileDownload, IconFileImport, IconFileInfo, IconFilePencil, IconFiles, IconFileText, IconFileUpload, IconFilter, IconFilterOff, IconFishHook, IconFolderBolt, IconGripVertical, IconHandClick, IconHeading, IconHelp, IconHexagons, IconHierarchy, IconHierarchy3, IconHistory, IconHome, IconHourglass, IconHourglassEmpty, IconInfoCircle, IconInfoCircleFilled, IconInfoSquare, IconLayoutList, IconLayoutNavbarCollapse, IconLayoutSidebar, IconLetterGSmall, IconLink, IconList, IconLoader, IconLoader2, IconLockAccess, IconMap, IconMaximize, IconMessageCircle, IconMessageCircleSearch, IconMessages, IconMinimize, IconMinus, IconMoustache, IconNews, IconNotes, IconPencil, IconPlayCardStar, IconPlayerPlay, IconPlayerPlayFilled, IconPlus, IconPoint, IconPointerOff, IconPointerSearch, IconPointFilled, IconQuestionMark, IconRefresh, IconResize, IconRobot, IconRotate, IconScissors, IconScreenshot, IconSearch, IconSend, IconSettings, IconShieldCheckFilled, IconShieldFilled, IconSquare, IconSquareCheck, IconStar, IconTag, IconTemplate, IconTerminal, IconThumbDown, IconThumbDownFilled, IconThumbUp, IconThumbUpFilled, IconTrash, IconTrashXFilled, IconTriangleInverted, IconTriangleSquareCircle, IconUpload, IconUser, IconUsersGroup, IconUserX, IconVariable, IconVariablePlus, IconVersions, IconWand, IconWaveSine, IconWebhook, IconWreckingBall, IconX, IconZoomCode } from '@tabler/icons-react';
2+
import { IconActivity, IconAdjustments, IconAdjustmentsAlt, IconAdjustmentsOff, IconAlertCircle, IconAlertTriangle, IconAlertTriangleFilled, IconAngle, IconApi, IconArchive, IconArrowAutofitDown, IconArrowCurveRight, IconArrowDown, IconArrowLeft, IconArrowNarrowLeft, IconArrowNarrowRight, IconArrowRight, IconArrowsRandom, IconArrowsSort, IconArrowUp, IconArrowUpRight, IconAssembly, IconBallpen, IconBallpenOff, IconBell, IconBolt, IconBottle, IconBox, IconBoxOff, IconBrandGithub, IconBrandOpenai, IconBrandPython, IconBulb, IconBulldozer, IconCamera, IconCategoryPlus, IconCell, IconChartBubble, IconChartCircles, IconChartDots3, IconChartLine, IconChartPie, IconCheck, IconChecks, IconChevronCompactLeft, IconChevronCompactRight, IconChevronDown, IconChevronLeft, IconChevronRight, IconChevronUp, IconCircle, IconCircleCheck, IconCircleCheckFilled, IconCircleMinus, IconCirclePlus, IconClick, IconClipboard, IconClipboardCheck, IconClipboardOff, IconClock, IconCode, IconCodePlus, IconColorPicker, IconColumns, IconColumns1, IconColumns2, IconColumns3, IconCopy, IconCrown, IconCrownOff, IconDatabase, IconDatabasePlus, IconDeviceFloppy, IconDots, IconDotsVertical, IconDownload, IconEdit, IconEngine, IconExclamationCircle, IconExclamationMark, IconExternalLink, IconEye, IconEyeCancel, IconEyeCheck, IconEyeOff, IconFile, IconFileDownload, IconFileImport, IconFileInfo, IconFilePencil, IconFiles, IconFileText, IconFileUpload, IconFilter, IconFilterOff, IconFishHook, IconFolderBolt, IconGitCommit, IconGripVertical, IconHandClick, IconHeading, IconHelp, IconHexagons, IconHierarchy, IconHierarchy3, IconHistory, IconHome, IconHourglass, IconHourglassEmpty, IconInfoCircle, IconInfoCircleFilled, IconInfoSquare, IconLayoutList, IconLayoutNavbarCollapse, IconLayoutSidebar, IconLetterGSmall, IconLink, IconList, IconLoader, IconLoader2, IconLockAccess, IconMap, IconMaximize, IconMessageCircle, IconMinus, IconMessageCircleSearch, IconMessages, IconMinimize, IconMoustache, IconNews, IconNotes, IconPencil, IconPlayCardStar, IconPlayerPlay, IconPlayerPlayFilled, IconPlus, IconPoint, IconPointerOff, IconPointerSearch, IconPointFilled, IconQuestionMark, IconRecycle, IconRefresh, IconRefreshAlert, IconResize, IconRobot, IconRotate, IconScissors, IconScreenshot, IconSearch, IconSend, IconSettings, IconShare, IconShieldCheckFilled, IconShieldFilled, IconSquare, IconSquareCheck, IconStar, IconTag, IconTemplate, IconTerminal, IconThumbDown, IconThumbDownFilled, IconThumbUp, IconThumbUpFilled, IconTrash, IconTrashXFilled, IconTriangleInverted, IconTriangleSquareCircle, IconUpload, IconUser, IconUsersGroup, IconUserX, IconVariable, IconVariablePlus, IconVersions, IconWand, IconWaveSine, IconWebhook, IconWreckingBall, IconX, IconZoomCode } from '@tabler/icons-react';
33

44
export const MemoIconHome = memo(IconHome);
55
export const MemoIconInfoCircle = memo(IconInfoCircle);
@@ -109,6 +109,7 @@ export const MemoIconDeviceFloppy = memo(IconDeviceFloppy);
109109
export const MemoIconNotes = memo(IconNotes);
110110
export const MemoIconFileDownload = memo(IconFileDownload);
111111
export const MemoIconTag = memo(IconTag);
112+
export const MemoIconCircleCheck = memo(IconCircleCheck);
112113
export const MemoIconCircleCheckFilled = memo(IconCircleCheckFilled);
113114
export const MemoIconCell = memo(IconCell);
114115
export const MemoIconArrowsSort = memo(IconArrowsSort);
@@ -173,6 +174,11 @@ export const MemoIconWreckingBall = memo(IconWreckingBall);
173174
export const MemoIconCamera = memo(IconCamera);
174175
export const MemoIconArrowAutofitDown = memo(IconArrowAutofitDown);
175176
export const MemoIconMessageCircleSearch = memo(IconMessageCircleSearch);
177+
export const MemoIconGitCommit = memo(IconGitCommit);
178+
export const MemoIconBrandGithub = memo(IconBrandGithub);
179+
export const MemoIconShare = memo(IconShare);
180+
export const MemoIconRecycle = memo(IconRecycle);
181+
export const MemoIconClock = memo(IconClock);
176182
export const MemoIconArrowNarrowLeft = memo(IconArrowNarrowLeft);
177183
export const MemoIconArrowNarrowRight = memo(IconArrowNarrowRight);
178-
export const MemoIconMinus = memo(IconMinus);
184+
export const MemoIconMinus = memo(IconMinus);

components/kern-table/CellComponents.tsx

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,10 @@ function OrganizationUserCell({ userToOrganization, organizations, user, onClick
8787
)}</>
8888
}
8989

90-
function DeleteUserCell({ user, deleteUser }) {
90+
function DeleteCell({ deleteEntity }) {
9191
const clickDelete = useCallback(() => {
92-
if (deleteUser) deleteUser(user);
93-
}, [deleteUser, user]);
92+
if (deleteEntity) deleteEntity();
93+
}, [deleteEntity]);
9494

9595
return <KernButton
9696
text="Delete"
@@ -308,4 +308,12 @@ function EmailCell({ user }) {
308308
)
309309
}
310310

311-
export { OrganizationAndUsersCell, MaxRowsColsCharsCell, CommentsCell, ExportConsumptionAndDeleteCell, BadgeCell, OrganizationUserCell, DeleteUserCell, LevelCell, ArchiveReasonCell, ProjectNameTaskCell, CancelTaskCell, IconCell, ConfigCell, EditDeleteOrgButtonCell, ViewStackCell, AbortSessionButtonCell, FeedbackMessageCell, FeedbackMessageTextCell, JumpToConversationCell, RemoteVersionCell, ExternalLinkCell, ModelDateCell, FileSizeCell, StatusModelCell, DeleteModelCell, LabelCell, ViewCell, EvaluationRunStateCell, EvaluationRunDetailsCell, EtlApiTokenCell, EmailCell }
311+
function EditIntegrationCell({ onClick }) {
312+
const clickEdit = useCallback(() => {
313+
if (onClick) onClick();
314+
}, [onClick]);
315+
316+
return <KernButton text="Edit" onClick={clickEdit} className="text-gray-700" />
317+
}
318+
319+
export { OrganizationAndUsersCell, MaxRowsColsCharsCell, CommentsCell, ExportConsumptionAndDeleteCell, BadgeCell, OrganizationUserCell, DeleteCell, LevelCell, ArchiveReasonCell, ProjectNameTaskCell, CancelTaskCell, IconCell, ConfigCell, EditDeleteOrgButtonCell, ViewStackCell, AbortSessionButtonCell, FeedbackMessageCell, FeedbackMessageTextCell, JumpToConversationCell, RemoteVersionCell, ExternalLinkCell, ModelDateCell, FileSizeCell, StatusModelCell, DeleteModelCell, LabelCell, ViewCell, EvaluationRunStateCell, EvaluationRunDetailsCell, EtlApiTokenCell, EmailCell, EditIntegrationCell }

components/kern-table/KernTable.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import SortArrows from "@/submodules/react-components/components/kern-table/SortArrows";
22
import { KernTableProps } from "../../types/kern-table";
3-
import { AbortSessionButtonCell, ArchiveReasonCell, BadgeCell, CancelTaskCell, CommentsCell, ConfigCell, DeleteModelCell, DeleteUserCell, EditDeleteOrgButtonCell, EmailCell, EtlApiTokenCell, EvaluationRunDetailsCell, EvaluationRunStateCell, ExportConsumptionAndDeleteCell, ExternalLinkCell, FeedbackMessageCell, FeedbackMessageTextCell, FileSizeCell, IconCell, JumpToConversationCell, LabelCell, LevelCell, MaxRowsColsCharsCell, ModelDateCell, OrganizationAndUsersCell, OrganizationUserCell, ProjectNameTaskCell, RemoteVersionCell, StatusModelCell, ViewCell, ViewStackCell } from "./CellComponents";
3+
import { AbortSessionButtonCell, ArchiveReasonCell, BadgeCell, CancelTaskCell, CommentsCell, ConfigCell, DeleteModelCell, DeleteCell, EditDeleteOrgButtonCell, EmailCell, EtlApiTokenCell, EvaluationRunDetailsCell, EvaluationRunStateCell, ExportConsumptionAndDeleteCell, ExternalLinkCell, FeedbackMessageCell, FeedbackMessageTextCell, FileSizeCell, IconCell, JumpToConversationCell, LabelCell, LevelCell, MaxRowsColsCharsCell, ModelDateCell, OrganizationAndUsersCell, OrganizationUserCell, ProjectNameTaskCell, RemoteVersionCell, StatusModelCell, ViewCell, ViewStackCell, EditIntegrationCell } from "./CellComponents";
44
import { Fragment, useMemo } from "react";
55
import KernDropdown from "../KernDropdown";
66
import { NotApplicableBadge } from "@/submodules/react-components/components/Badges";
@@ -104,8 +104,8 @@ function ComponentMapper(cell: any) {
104104
return <BadgeCell {...cell} />;
105105
case 'OrganizationUserCell':
106106
return <OrganizationUserCell {...cell} />;
107-
case 'DeleteUserCell':
108-
return <DeleteUserCell {...cell} />;
107+
case 'DeleteCell':
108+
return <DeleteCell {...cell} />;
109109
case 'LevelCell':
110110
return <LevelCell {...cell} />;
111111
case 'ArchiveReasonCell':
@@ -154,6 +154,8 @@ function ComponentMapper(cell: any) {
154154
return <EtlApiTokenCell {...cell} />;
155155
case 'EmailCell':
156156
return <EmailCell {...cell} />;
157+
case 'EditIntegrationCell':
158+
return <EditIntegrationCell {...cell} />;
157159
}
158160
case 'text':
159161
return <span>{cell.value ?? <NotApplicableBadge />}</span>

0 commit comments

Comments
 (0)