feat: get object metadata from backend in Object Detail and New Field… (#2122)
* feat: get object metadata from backend in Object Detail and New Field - Step 1 Closes #2008 * refactor: add useLazyLoadIcon hook
This commit is contained in:
@ -4,14 +4,13 @@ import styled from '@emotion/styled';
|
||||
|
||||
import { useFindManyObjects } from '@/metadata/hooks/useFindManyObjects';
|
||||
import { MetadataObject } from '@/metadata/types/MetadataObject';
|
||||
import { IconComponent } from '@/ui/display/icon/types/IconComponent';
|
||||
import { Tag } from '@/ui/display/tag/components/Tag';
|
||||
import { useLazyLoadIcon } from '@/ui/input/hooks/useLazyLoadIcon';
|
||||
import { TableCell } from '@/ui/layout/table/components/TableCell';
|
||||
import { TableRow } from '@/ui/layout/table/components/TableRow';
|
||||
|
||||
type SettingsObjectItemTableRowProps = {
|
||||
action: ReactNode;
|
||||
Icon?: IconComponent;
|
||||
objectItem: MetadataObject;
|
||||
onClick?: () => void;
|
||||
};
|
||||
@ -37,7 +36,6 @@ const StyledActionTableCell = styled(TableCell)`
|
||||
|
||||
export const SettingsObjectItemTableRow = ({
|
||||
action,
|
||||
Icon,
|
||||
objectItem,
|
||||
onClick,
|
||||
}: SettingsObjectItemTableRowProps) => {
|
||||
@ -47,6 +45,8 @@ export const SettingsObjectItemTableRow = ({
|
||||
objectNamePlural: objectItem.namePlural,
|
||||
});
|
||||
|
||||
const { Icon } = useLazyLoadIcon(objectItem.icon ?? '');
|
||||
|
||||
return (
|
||||
<StyledObjectTableRow key={objectItem.namePlural} onClick={onClick}>
|
||||
<StyledNameTableCell>
|
||||
|
||||
Reference in New Issue
Block a user