Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | 22x | import { Stack } from "@mui/material";
import { PencilSimpleIcon } from "@phosphor-icons/react";
import GiveIconButton from "@shared/IconButton/GiveIconButton";
import GiveText from "@shared/Text/GiveText";
export default function ValueWithEdit({
text,
onEdit,
testId,
readOnly,
}: {
text: string;
onEdit: () => void;
testId?: string;
readOnly?: boolean;
}) {
return (
<Stack
direction="row"
justifyContent="space-between"
alignItems="center"
height="20px"
>
<GiveText variant="bodyS">{text}</GiveText>
{!readOnly && (
<GiveIconButton
Icon={PencilSimpleIcon}
variant="ghost"
size="small"
onClick={onEdit}
data-testid={testId}
/>
)}
</Stack>
);
}
|