import { Button, ButtonGroup, Chip, Divider } from '@material-ui/core'; import React, { Component, useState } from 'react'; import KeyboardArrowUpIcon from '@mui/icons-material/KeyboardArrowUp'; import KeyboardArrowDownIcon from '@mui/icons-material/KeyboardArrowUp'; import "./Nugget.css"; import { Nugget as NuggetType, decreaseNuggetScore, increaseNuggetScore } from '../lib/prompt'; export interface NuggetProps { nugget : NuggetType, } export default function Nugget(props : NuggetProps) { const {nugget} = props; const scoreDisp = nugget.score > 0 ? "+" + nugget.score : nugget.score; return (
{nugget.item.name || nugget.item.prompt} {scoreDisp}
); }