generated from layer5io/layer5-repo-template
-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into feat/panel
Showing
33 changed files
with
692 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,13 @@ | ||
import { Pagination as MuiPagination, PaginationProps as MuiPaginationProps } from '@mui/material'; | ||
import { | ||
Pagination as MuiPagination, | ||
PaginationItem as MuiPaginationItem, | ||
PaginationProps as MuiPaginationProps | ||
} from '@mui/material'; | ||
import React from 'react'; | ||
|
||
const Pagination = React.forwardRef<HTMLDivElement, MuiPaginationProps>((props, ref) => { | ||
return <MuiPagination {...props} ref={ref} />; | ||
}); | ||
|
||
export { MuiPaginationItem as PaginationItem }; | ||
export default Pagination; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import { PaginationProps } from '@mui/material'; | ||
import Pagination from './Pagination'; | ||
import Pagination, { PaginationItem } from './Pagination'; | ||
|
||
export { Pagination }; | ||
export { Pagination, PaginationItem }; | ||
export type { PaginationProps }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
import PromptComponent from './promt-component'; | ||
|
||
import PromptComponent, { PROMPT_VARIANTS } from './promt-component'; | ||
export { PROMPT_VARIANTS, PromptComponent }; | ||
export default PromptComponent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,312 @@ | ||
/* eslint-disable @typescript-eslint/no-explicit-any */ | ||
import ExpandMoreIcon from '@mui/icons-material/ExpandMore'; | ||
import { MUIDataTableColumn, MUIDataTableMeta } from 'mui-datatables'; | ||
import React, { useState } from 'react'; | ||
import { Accordion, AccordionDetails, AccordionSummary, Typography } from '../../base'; | ||
import { DeleteIcon, EnvironmentIcon } from '../../icons'; | ||
import { CHARCOAL, SistentThemeProvider } from '../../theme'; | ||
import { NameDiv } from '../CatalogDesignTable/style'; | ||
import { RESOURCE_TYPES } from '../CatalogDetail/types'; | ||
import { CustomColumnVisibilityControl } from '../CustomColumnVisibilityControl'; | ||
import { CustomTooltip } from '../CustomTooltip'; | ||
import { ConditionalTooltip } from '../Helpers/CondtionalTooltip'; | ||
import { useWindowDimensions } from '../Helpers/Dimension'; | ||
import { | ||
ColView, | ||
updateVisibleColumns | ||
} from '../Helpers/ResponsiveColumns/responsive-coulmns.tsx/responsive-column'; | ||
import ResponsiveDataTable, { IconWrapper } from '../ResponsiveDataTable'; | ||
import SearchBar from '../SearchBar'; | ||
import { TooltipIcon } from '../TooltipIconButton'; | ||
import AssignmentModal from './AssignmentModal'; | ||
import EditButton from './EditButton'; | ||
import useViewAssignment from './hooks/useViewsAssignment'; | ||
import { CellStyle, CustomBodyRenderStyle, TableHeader, TableRightActionHeader } from './styles'; | ||
|
||
interface ViewsTableProps { | ||
workspaceId: string; | ||
workspaceName: string; | ||
useGetViewsOfWorkspaceQuery: any; | ||
useUnassignViewFromWorkspaceMutation: any; | ||
useAssignViewToWorkspaceMutation: any; | ||
isRemoveAllowed: boolean; | ||
isAssignAllowed: boolean; | ||
handleShowDetails: (viewId: string, viewName: string, filterType: string) => void; | ||
} | ||
|
||
const colViews: ColView[] = [ | ||
['id', 'na'], | ||
['name', 'xs'], | ||
['description', 'm'], | ||
['organization_id', 'l'], | ||
['created_at', 'xl'], | ||
['updated_at', 'xl'], | ||
['visibility', 'l'], | ||
['actions', 'xs'] | ||
]; | ||
|
||
export const ResizableDescriptionCell = ({ value }: { value: string }) => ( | ||
<div style={{ position: 'relative', height: '20px' }}> | ||
<CustomBodyRenderStyle> | ||
<CellStyle> | ||
<CustomTooltip title={value} placement="top-start"> | ||
<span style={{ cursor: 'pointer' }}>{value}</span> | ||
</CustomTooltip> | ||
</CellStyle> | ||
</CustomBodyRenderStyle> | ||
</div> | ||
); | ||
|
||
const WorkspaceViewsTable: React.FC<ViewsTableProps> = ({ | ||
workspaceId, | ||
workspaceName, | ||
isRemoveAllowed, | ||
useGetViewsOfWorkspaceQuery, | ||
useUnassignViewFromWorkspaceMutation, | ||
useAssignViewToWorkspaceMutation, | ||
isAssignAllowed, | ||
handleShowDetails | ||
}) => { | ||
const [expanded, setExpanded] = useState<boolean>(true); | ||
const handleAccordionChange = () => { | ||
setExpanded(!expanded); | ||
}; | ||
const [search, setSearch] = useState(''); | ||
const [isSearchExpanded, setIsSearchExpanded] = useState(false); | ||
const [page, setPage] = useState<number>(0); | ||
const [pageSize, setPageSize] = useState<number>(10); | ||
const [sortOrder, setSortOrder] = useState<string>('updated_at desc'); | ||
const { data: viewsOfWorkspace } = useGetViewsOfWorkspaceQuery({ | ||
workspaceId, | ||
page: page, | ||
pageSize: pageSize, | ||
search: search, | ||
order: sortOrder | ||
}); | ||
const { width } = useWindowDimensions(); | ||
const [unassignviewFromWorkspace] = useUnassignViewFromWorkspaceMutation(); | ||
const columns: MUIDataTableColumn[] = [ | ||
{ | ||
name: 'id', | ||
label: 'ID', | ||
options: { | ||
filter: false, | ||
customBodyRender: (value) => <ConditionalTooltip value={value} maxLength={10} /> | ||
} | ||
}, | ||
{ | ||
name: 'name', | ||
label: 'Name', | ||
options: { | ||
filter: false, | ||
sort: true, | ||
searchable: true, | ||
customBodyRender: (value, tableMeta) => { | ||
const viewId = tableMeta.tableData[tableMeta.rowIndex]?.id ?? ''; | ||
const viewName = tableMeta.tableData[tableMeta.rowIndex]?.name ?? ''; | ||
return ( | ||
<NameDiv onClick={() => handleShowDetails(viewId, viewName, RESOURCE_TYPES.VIEW)}> | ||
{value} | ||
</NameDiv> | ||
); | ||
} | ||
} | ||
}, | ||
{ | ||
name: 'created_at', | ||
label: 'Created At', | ||
options: { | ||
filter: false, | ||
sort: true, | ||
searchable: true, | ||
setCellHeaderProps: () => { | ||
return { align: 'center' }; | ||
} | ||
} | ||
}, | ||
{ | ||
name: 'updated_at', | ||
label: 'Updated At', | ||
options: { | ||
filter: false, | ||
sort: true, | ||
searchable: true, | ||
setCellHeaderProps: () => { | ||
return { align: 'center' }; | ||
} | ||
} | ||
}, | ||
{ | ||
name: 'visibility', | ||
label: 'Visibility', | ||
options: { | ||
filter: false, | ||
sort: false, | ||
searchable: true, | ||
setCellHeaderProps: () => { | ||
return { align: 'center' }; | ||
} | ||
} | ||
}, | ||
{ | ||
name: 'actions', | ||
label: 'Actions', | ||
options: { | ||
filter: false, | ||
sort: false, | ||
searchable: false, | ||
customBodyRender: (_: string, tableMeta: MUIDataTableMeta) => ( | ||
<IconWrapper disabled={!isRemoveAllowed}> | ||
<TooltipIcon | ||
id={`delete_team-${tableMeta.rowIndex}`} | ||
title="Remove View" | ||
onClick={() => { | ||
isRemoveAllowed && | ||
unassignviewFromWorkspace({ | ||
workspaceId, | ||
viewId: tableMeta.rowData[0] | ||
}); | ||
}} | ||
iconType="delete" | ||
> | ||
<DeleteIcon height={28} width={28} fill={CHARCOAL} /> | ||
</TooltipIcon> | ||
</IconWrapper> | ||
) | ||
} | ||
} | ||
]; | ||
|
||
const viewAssignment = useViewAssignment({ | ||
workspaceId, | ||
useGetViewsOfWorkspaceQuery, | ||
useUnassignViewFromWorkspaceMutation, | ||
useAssignViewToWorkspaceMutation | ||
}); | ||
|
||
const [columnVisibility, setColumnVisibility] = useState<Record<string, boolean>>(() => { | ||
const showCols = updateVisibleColumns(colViews, width); | ||
const initialVisibility: Record<string, boolean> = {}; | ||
columns.forEach((col) => { | ||
initialVisibility[col.name] = showCols[col.name]; | ||
}); | ||
return initialVisibility; | ||
}); | ||
|
||
const options = { | ||
filter: false, | ||
responsive: 'standard', | ||
selectableRows: 'none', | ||
count: viewsOfWorkspace?.total_count, | ||
rowsPerPage: pageSize, | ||
page, | ||
elevation: 0, | ||
sortOrder: { | ||
name: sortOrder.split(' ')[0], | ||
direction: sortOrder.split(' ')[1] | ||
}, | ||
onTableChange: (action: string, tableState: any) => { | ||
const sortInfo = tableState.announceText ? tableState.announceText.split(' : ') : []; | ||
let order = ''; | ||
if (tableState.activeColumn) { | ||
order = `${columns[tableState.activeColumn].name} desc`; | ||
} | ||
switch (action) { | ||
case 'changePage': | ||
setPage(tableState.page); | ||
break; | ||
case 'changeRowsPerPage': | ||
setPageSize(tableState.rowsPerPage); | ||
break; | ||
case 'sort': | ||
if (sortInfo.length == 2) { | ||
if (sortInfo[1] === 'ascending') { | ||
order = `${columns[tableState.activeColumn].name} asc`; | ||
} else { | ||
order = `${columns[tableState.activeColumn].name} desc`; | ||
} | ||
} | ||
if (order !== sortOrder) { | ||
setSortOrder(order); | ||
} | ||
break; | ||
} | ||
} | ||
}; | ||
const [tableCols, updateCols] = useState(columns); | ||
|
||
return ( | ||
<SistentThemeProvider> | ||
<Accordion expanded={expanded} onChange={handleAccordionChange} style={{ margin: 0 }}> | ||
<AccordionSummary | ||
expandIcon={<ExpandMoreIcon />} | ||
sx={{ | ||
backgroundColor: 'background.paper' | ||
}} | ||
> | ||
<TableHeader> | ||
<Typography variant="h6" fontWeight={'bold'}> | ||
Assigned Views | ||
</Typography> | ||
<TableRightActionHeader> | ||
<SearchBar | ||
onSearch={(value) => { | ||
setSearch(value); | ||
}} | ||
onClear={() => { | ||
setSearch(''); | ||
}} | ||
expanded={isSearchExpanded} | ||
setExpanded={setIsSearchExpanded} | ||
placeholder="Search workspaces..." | ||
/> | ||
<CustomColumnVisibilityControl | ||
columns={columns} | ||
customToolsProps={{ | ||
columnVisibility, | ||
setColumnVisibility | ||
}} | ||
id={'views-table'} | ||
/> | ||
<EditButton onClick={viewAssignment.handleAssignModal} disabled={!isAssignAllowed} /> | ||
</TableRightActionHeader> | ||
</TableHeader> | ||
</AccordionSummary> | ||
<AccordionDetails style={{ padding: 0 }}> | ||
<ResponsiveDataTable | ||
columns={columns} | ||
data={viewsOfWorkspace?.views} | ||
options={options} | ||
colViews={colViews} | ||
tableCols={tableCols} | ||
updateCols={updateCols} | ||
columnVisibility={columnVisibility} | ||
/> | ||
</AccordionDetails> | ||
</Accordion> | ||
|
||
<AssignmentModal | ||
open={viewAssignment.assignModal} | ||
onClose={viewAssignment.handleAssignModalClose} | ||
title={`Assign Views to ${workspaceName}`} | ||
headerIcon={<EnvironmentIcon height="40" width="40" fill={'white'} />} | ||
name="Views" | ||
assignableData={viewAssignment.data} | ||
handleAssignedData={viewAssignment.handleAssignData} | ||
originalAssignedData={viewAssignment.workspaceData} | ||
emptyStateIcon={<EnvironmentIcon height="5rem" width="5rem" fill={'#808080'} />} | ||
handleAssignablePage={viewAssignment.handleAssignablePage} | ||
handleAssignedPage={viewAssignment.handleAssignedPage} | ||
originalLeftCount={viewAssignment.data?.length || 0} | ||
originalRightCount={viewsOfWorkspace?.total_count || 0} | ||
onAssign={viewAssignment.handleAssign} | ||
disableTransfer={viewAssignment.disableTransferButton} | ||
helpText={`Assign Views to ${workspaceName}`} | ||
isAssignAllowed={isAssignAllowed} | ||
isRemoveAllowed={isRemoveAllowed} | ||
/> | ||
</SistentThemeProvider> | ||
); | ||
}; | ||
|
||
export default WorkspaceViewsTable; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,158 @@ | ||
/* eslint-disable @typescript-eslint/no-explicit-any */ | ||
import { useEffect, useState } from 'react'; | ||
import { Pattern } from '../../CustomCatalog/CustomCard'; | ||
import { withDefaultPageArgs } from '../../PerformersSection/PerformersSection'; | ||
import { AssignmentHookResult } from '../types'; | ||
|
||
interface AddedAndRemovedViews { | ||
addedviewsIds: string[]; | ||
removedviewsIds: string[]; | ||
} | ||
|
||
interface useViewAssignmentProps { | ||
workspaceId: string; | ||
useGetViewsOfWorkspaceQuery: any; | ||
useAssignViewToWorkspaceMutation: any; | ||
useUnassignViewFromWorkspaceMutation: any; | ||
} | ||
|
||
const useViewAssignment = ({ | ||
workspaceId, | ||
useGetViewsOfWorkspaceQuery, | ||
useAssignViewToWorkspaceMutation, | ||
useUnassignViewFromWorkspaceMutation | ||
}: useViewAssignmentProps): AssignmentHookResult<Pattern> => { | ||
const [viewsPage, setviewsPage] = useState<number>(0); | ||
const [viewsData, setviewsData] = useState<Pattern[]>([]); | ||
const viewsPageSize = 25; | ||
const [viewsOfWorkspacePage, setviewsOfWorkspacePage] = useState<number>(0); | ||
const [workspaceviewsData, setWorkspaceviewsData] = useState<Pattern[]>([]); | ||
const [assignviewModal, setAssignviewModal] = useState<boolean>(false); | ||
const [skipviews, setSkipviews] = useState<boolean>(true); | ||
const [disableTransferButton, setDisableTransferButton] = useState<boolean>(true); | ||
const [assignedviews, setAssignedviews] = useState<Pattern[]>([]); | ||
|
||
const { data: views } = useGetViewsOfWorkspaceQuery( | ||
withDefaultPageArgs({ | ||
workspaceId, | ||
page: viewsPage, | ||
pagesize: viewsPageSize, | ||
filter: '{"assigned":false}' | ||
}), | ||
{ | ||
skip: skipviews | ||
} | ||
); | ||
|
||
const { data: viewsOfWorkspace } = useGetViewsOfWorkspaceQuery( | ||
withDefaultPageArgs({ | ||
workspaceId, | ||
page: viewsOfWorkspacePage, | ||
pagesize: viewsPageSize | ||
}), | ||
{ | ||
skip: skipviews | ||
} | ||
); | ||
|
||
const [assignviewToWorkspace] = useAssignViewToWorkspaceMutation(); | ||
const [unassignviewFromWorkspace] = useUnassignViewFromWorkspaceMutation(); | ||
|
||
useEffect(() => { | ||
const viewsDataRtk = views?.views ? views.views : []; | ||
setviewsData((prevData) => [...prevData, ...viewsDataRtk]); | ||
}, [views]); | ||
|
||
useEffect(() => { | ||
const viewsOfWorkspaceDataRtk = viewsOfWorkspace?.views ? viewsOfWorkspace.views : []; | ||
setWorkspaceviewsData((prevData) => [...prevData, ...viewsOfWorkspaceDataRtk]); | ||
}, [viewsOfWorkspace]); | ||
|
||
const handleAssignviewModal = (e?: React.MouseEvent): void => { | ||
e?.stopPropagation(); | ||
setAssignviewModal(true); | ||
setSkipviews(false); | ||
}; | ||
|
||
const handleAssignviewModalClose = (e?: React.MouseEvent): void => { | ||
e?.stopPropagation(); | ||
setAssignviewModal(false); | ||
setSkipviews(true); | ||
}; | ||
|
||
const handleAssignablePageview = (): void => { | ||
const pagesCount = Math.ceil(Number(views?.total_count) / viewsPageSize); | ||
if (viewsPage < pagesCount - 1) { | ||
setviewsPage((prevviewsPage) => prevviewsPage + 1); | ||
} | ||
}; | ||
|
||
const handleAssignedPageview = (): void => { | ||
const pagesCount = Math.ceil(Number(viewsOfWorkspace?.total_count) / viewsPageSize); | ||
if (viewsOfWorkspacePage < pagesCount - 1) { | ||
setviewsOfWorkspacePage((prevPage) => prevPage + 1); | ||
} | ||
}; | ||
|
||
const getAddedAndRemovedviews = (allAssignedviews: Pattern[]): AddedAndRemovedViews => { | ||
const originalviewsIds = workspaceviewsData.map((view) => view.id); | ||
const updatedviewsIds = allAssignedviews.map((view) => view.id); | ||
|
||
const addedviewsIds = updatedviewsIds.filter((id) => !originalviewsIds.includes(id)); | ||
const removedviewsIds = originalviewsIds.filter((id) => !updatedviewsIds.includes(id)); | ||
|
||
return { addedviewsIds, removedviewsIds }; | ||
}; | ||
|
||
const isViewsActivityOccurred = (allViews: Pattern[]): boolean => { | ||
const { addedviewsIds, removedviewsIds } = getAddedAndRemovedviews(allViews); | ||
return addedviewsIds.length > 0 || removedviewsIds.length > 0; | ||
}; | ||
|
||
const handleAssignviews = async (): Promise<void> => { | ||
const { addedviewsIds, removedviewsIds } = getAddedAndRemovedviews(assignedviews); | ||
|
||
addedviewsIds.map((id) => | ||
assignviewToWorkspace({ | ||
workspaceId, | ||
viewId: id | ||
}).unwrap() | ||
); | ||
|
||
removedviewsIds.map((id) => | ||
unassignviewFromWorkspace({ | ||
workspaceId, | ||
viewId: id | ||
}).unwrap() | ||
); | ||
|
||
setviewsData([]); | ||
setWorkspaceviewsData([]); | ||
setviewsPage(0); | ||
setviewsOfWorkspacePage(0); | ||
handleAssignviewModalClose(); | ||
}; | ||
|
||
const handleAssignviewsData = (updatedAssignedData: Pattern[]): void => { | ||
const { addedviewsIds, removedviewsIds } = getAddedAndRemovedviews(updatedAssignedData); | ||
setDisableTransferButton(!(addedviewsIds.length > 0 || removedviewsIds.length > 0)); | ||
setAssignedviews(updatedAssignedData); | ||
}; | ||
|
||
return { | ||
data: viewsData, | ||
workspaceData: workspaceviewsData, | ||
assignModal: assignviewModal, | ||
handleAssignModal: handleAssignviewModal, | ||
handleAssignModalClose: handleAssignviewModalClose, | ||
handleAssignablePage: handleAssignablePageview, | ||
handleAssignedPage: handleAssignedPageview, | ||
handleAssign: handleAssignviews, | ||
isActivityOccurred: isViewsActivityOccurred, | ||
handleAssignData: handleAssignviewsData, | ||
disableTransferButton, | ||
assignedItems: assignedviews | ||
}; | ||
}; | ||
|
||
export default useViewAssignment; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,6 +57,7 @@ export { | |
darkSlateGray, | ||
darkTeal, | ||
eerieBlack, | ||
gray, | ||
green, | ||
jungleGreen, | ||
keppel, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
export const componentIcon = ({ | ||
kind, | ||
model, | ||
color | ||
}: { | ||
kind: string; | ||
model: string; | ||
color: 'white' | 'color' | 'complete'; | ||
}) => { | ||
if (!kind || !model || !color) { | ||
return null; | ||
} | ||
return `/ui/public/static/img/meshmodels/${model}/${color}/${kind.toLowerCase()}-${color}.svg`; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './components'; |