/*! Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: MIT-0 */ import React, {useState} from 'react'; import PiiDisplay from './PiiDisplay'; import { Grid, Row, Col, Table, Tag, Stack } from 'rsuite'; import ReloadIcon from '@rsuite/icons/Reload'; import CheckIcon from '@rsuite/icons/Check'; import BlockIcon from '@rsuite/icons/Block'; import RemindOutlineIcon from '@rsuite/icons/RemindOutline'; const { Column, HeaderCell, Cell } = Table; const CompactCell = (props) => { if(props.dataKey === "status"){ return {getStatus(props.rowData.status)} }else{ return ; } } const CompactHeaderCell = props => ; const defaultColumns = [ { key: 'document', label: 'Document', // width: 180, flexGrow: 2, verticalAlign: 'middle' }, { key: 'status', label: 'Status', // width: 180, flexGrow: 2, verticalAlign: 'middle' }, { key: 'job_id', label: 'Entity Detection Job ID', flexGrow: 2, verticalAlign: 'middle' } ]; const data =[ { "document": "discharge-summary.pdf", "status": "succeeded", "job_id": "a05a043c6361873b72c2917c8336b1c92b4b1499d1bf296cd3192eeea87d9e26" }, { "document": "doctors-note.png", "status": "succeeded", "job_id": "616252ea721fd066197a49349989f551e08752104d42fde57c4dbf3b8eb6ff72" } ]; const getStatus = (status) => { switch (status) { case "processing": return {status} case "succeeded": return processed case 'failed': case 'partial_success': return {status} default: return {status} } } const PiiTab = () => { const [columnKeys] = useState(defaultColumns.map(column => column.key)); const columns = defaultColumns.filter(column => columnKeys.some(key => key === column.key)); return ( // //
{columns.map(column => { const { key, label, ...rest } = column; return ( {label} ); })}
) } export default PiiTab;