11import { toggleElement } from '@mll-lab/js-utils' ;
22import React , { useState } from 'react' ;
3+ import styled from 'styled-components' ;
34
45import { Card } from '../Card' ;
56import { Table } from '../Table' ;
@@ -16,6 +17,14 @@ export {
1617 PipettingLossByFactor ,
1718} from './types' ;
1819
20+ const TOTAL_VOLUME_ROW_CLASS = 'total-volume-row' ;
21+
22+ const MasterMixTable = styled ( Table ) `
23+ .${ TOTAL_VOLUME_ROW_CLASS } {
24+ background-color: lightgrey;
25+ }
26+ ` ;
27+
1928/**
2029 * The reactants can be clicked and marked as pipetted.
2130 */
@@ -43,13 +52,17 @@ export function MasterMix(props: MasterMixProps) {
4352 < Typography . Title level = { 5 } > { props . name } MasterMix</ Typography . Title >
4453 }
4554 >
46- < Table
55+ < MasterMixTable
4756 style = { { maxWidth : 400 } }
48- rowClassName = { ( record ) =>
49- highlightedEntries . includes ( record . key . toString ( ) )
57+ rowClassName = { ( record , index ) => {
58+ if ( index === props . ingredients . length ) {
59+ return TOTAL_VOLUME_ROW_CLASS ;
60+ }
61+
62+ return highlightedEntries . includes ( record . key . toString ( ) )
5063 ? 'mll-ant-table-row-selected'
51- : ''
52- }
64+ : '' ;
65+ } }
5366 dataSource = { ingredientsWithSumRow }
5467 rowKey = { ( record ) => record . key }
5568 pagination = { { defaultPageSize : 10 , hideOnSinglePage : true } }
0 commit comments