system-praktyk-front/src/management/common/MultilangualCell.tsx
2020-11-18 23:06:06 +01:00

16 lines
514 B
TypeScript

import { Multilingual } from "@/data";
import React from "react";
import { Chip } from "@material-ui/core";
export type MultilingualCellProps = { value: Multilingual<React.ReactNode> }
export const MultilingualCell = ({ value }: MultilingualCellProps) => {
return <>
{ Object.keys(value).map(language => <div>
<Chip size="small" label={ language.toUpperCase() } style={ { marginRight: "0.5rem" } }/>
{ value[language as keyof Multilingual<any>] }
</div>) }
</>
}