mirror of
https://github.com/Sea-Haven-Industries/shoc-frontend-new.git
synced 2026-10-07 16:19:01 +00:00
refactor(work-orders): extract inline type/severity cell under function line cap
This commit is contained in:
parent
26add2e57c
commit
a50c17b260
1 changed files with 19 additions and 7 deletions
|
|
@ -28,6 +28,24 @@ type WoTableInlineRowCellsProps = {
|
||||||
onPatch: (patch: Partial<WorkOrderTableDraft>) => void;
|
onPatch: (patch: Partial<WorkOrderTableDraft>) => void;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
function InlineTypeSeverityCell({
|
||||||
|
draft,
|
||||||
|
onPatch,
|
||||||
|
}: {
|
||||||
|
draft: WorkOrderTableDraft;
|
||||||
|
onPatch: (patch: Partial<WorkOrderTableDraft>) => void;
|
||||||
|
}) {
|
||||||
|
return (
|
||||||
|
<td className="group/cell" style={{ padding: "0 14px" }}>
|
||||||
|
<TypeCell
|
||||||
|
value={draft.type}
|
||||||
|
severity={draft.severity}
|
||||||
|
onSave={(t, sev) => onPatch({ type: t, severity: sev })}
|
||||||
|
/>
|
||||||
|
</td>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
export function WoTableInlineRowCells({
|
export function WoTableInlineRowCells({
|
||||||
draft,
|
draft,
|
||||||
weekDefault,
|
weekDefault,
|
||||||
|
|
@ -77,13 +95,7 @@ export function WoTableInlineRowCells({
|
||||||
/>
|
/>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td className="group/cell" style={{ padding: "0 14px" }}>
|
<InlineTypeSeverityCell draft={draft} onPatch={onPatch} />
|
||||||
<TypeCell
|
|
||||||
value={draft.type}
|
|
||||||
severity={draft.severity}
|
|
||||||
onSave={(t, sev) => onPatch({ type: t, severity: sev })}
|
|
||||||
/>
|
|
||||||
</td>
|
|
||||||
|
|
||||||
<td className="group/cell" style={{ padding: "0 14px" }}>
|
<td className="group/cell" style={{ padding: "0 14px" }}>
|
||||||
<AssignedToCell
|
<AssignedToCell
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue