mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-30 12:18:11 +00:00
fix data table
This commit is contained in:
@@ -34,73 +34,9 @@ const FleetRecordActions = ({
|
||||
|
||||
if (layout === "compact") {
|
||||
return (
|
||||
<Group gap={6} wrap="nowrap" justify="flex-end">
|
||||
{isVehicle && onAssignDriver ? (
|
||||
<Tooltip label="Assign Driver">
|
||||
<ActionIcon
|
||||
variant="subtle"
|
||||
color="blue"
|
||||
size="sm"
|
||||
onClick={() => onAssignDriver(record)}
|
||||
>
|
||||
<Users size={16} strokeWidth={2} />
|
||||
</ActionIcon>
|
||||
</Tooltip>
|
||||
) : null}
|
||||
<Tooltip label="Edit">
|
||||
<ActionIcon
|
||||
variant="subtle"
|
||||
color="blue"
|
||||
size="sm"
|
||||
onClick={() => onEdit(record)}
|
||||
>
|
||||
<Edit2 size={16} strokeWidth={2} />
|
||||
</ActionIcon>
|
||||
</Tooltip>
|
||||
<Menu position="bottom-end" withinPortal shadow="md">
|
||||
<Menu.Target>
|
||||
<Tooltip label="More actions">
|
||||
<ActionIcon
|
||||
variant="subtle"
|
||||
color="gray"
|
||||
size="sm"
|
||||
>
|
||||
<MoreVertical size={16} strokeWidth={2} />
|
||||
</ActionIcon>
|
||||
</Tooltip>
|
||||
</Menu.Target>
|
||||
<Menu.Dropdown>
|
||||
{showDetail ? (
|
||||
<MenuItem onClick={handleDetail} leftSection={<Eye size={14} strokeWidth={2} />}>
|
||||
View details
|
||||
</MenuItem>
|
||||
) : null}
|
||||
<MenuItem color="red" onClick={() => onRemove(record)} leftSection={<Trash2 size={14} strokeWidth={2} />}>
|
||||
{removeLabel}
|
||||
</MenuItem>
|
||||
</Menu.Dropdown>
|
||||
</Menu>
|
||||
</Group>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<Group gap={6} wrap="nowrap" justify="flex-end">
|
||||
{isVehicle && onAssignDriver ? (
|
||||
<Tooltip label="Assign Driver">
|
||||
<ActionIcon variant="subtle" color="blue" size="sm" onClick={() => onAssignDriver(record)}>
|
||||
<Users size={16} strokeWidth={2} />
|
||||
</ActionIcon>
|
||||
</Tooltip>
|
||||
) : null}
|
||||
<Tooltip label="Edit">
|
||||
<ActionIcon variant="subtle" color="blue" size="sm" onClick={() => onEdit(record)}>
|
||||
<Edit2 size={16} strokeWidth={2} />
|
||||
</ActionIcon>
|
||||
</Tooltip>
|
||||
<Menu position="bottom-end" withinPortal shadow="md">
|
||||
<Menu.Target>
|
||||
<Tooltip label="More actions">
|
||||
<Tooltip label="Actions">
|
||||
<ActionIcon
|
||||
variant="subtle"
|
||||
color="gray"
|
||||
@@ -111,6 +47,14 @@ const FleetRecordActions = ({
|
||||
</Tooltip>
|
||||
</Menu.Target>
|
||||
<Menu.Dropdown>
|
||||
{isVehicle && onAssignDriver ? (
|
||||
<MenuItem onClick={() => onAssignDriver(record)} leftSection={<Users size={14} strokeWidth={2} />}>
|
||||
Assign Driver
|
||||
</MenuItem>
|
||||
) : null}
|
||||
<MenuItem onClick={() => onEdit(record)} leftSection={<Edit2 size={14} strokeWidth={2} />}>
|
||||
Edit
|
||||
</MenuItem>
|
||||
{showDetail ? (
|
||||
<MenuItem onClick={handleDetail} leftSection={<Eye size={14} strokeWidth={2} />}>
|
||||
View details
|
||||
@@ -121,7 +65,41 @@ const FleetRecordActions = ({
|
||||
</MenuItem>
|
||||
</Menu.Dropdown>
|
||||
</Menu>
|
||||
</Group>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<Menu position="bottom-end" withinPortal shadow="md">
|
||||
<Menu.Target>
|
||||
<Tooltip label="Actions">
|
||||
<ActionIcon
|
||||
variant="subtle"
|
||||
color="gray"
|
||||
size="sm"
|
||||
>
|
||||
<MoreVertical size={16} strokeWidth={2} />
|
||||
</ActionIcon>
|
||||
</Tooltip>
|
||||
</Menu.Target>
|
||||
<Menu.Dropdown>
|
||||
{isVehicle && onAssignDriver ? (
|
||||
<MenuItem onClick={() => onAssignDriver(record)} leftSection={<Users size={14} strokeWidth={2} />}>
|
||||
Assign Driver
|
||||
</MenuItem>
|
||||
) : null}
|
||||
<MenuItem onClick={() => onEdit(record)} leftSection={<Edit2 size={14} strokeWidth={2} />}>
|
||||
Edit
|
||||
</MenuItem>
|
||||
{showDetail ? (
|
||||
<MenuItem onClick={handleDetail} leftSection={<Eye size={14} strokeWidth={2} />}>
|
||||
View details
|
||||
</MenuItem>
|
||||
) : null}
|
||||
<MenuItem color="red" onClick={() => onRemove(record)} leftSection={<Trash2 size={14} strokeWidth={2} />}>
|
||||
{removeLabel}
|
||||
</MenuItem>
|
||||
</Menu.Dropdown>
|
||||
</Menu>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user