Bổ sung màu mới cho nút copy pid+sn
This commit is contained in:
parent
e119d9c831
commit
ae52635c2c
|
|
@ -299,6 +299,8 @@ const CardLine = ({
|
|||
value={`${line.inventory?.pid} ${line.inventory?.sn}`}
|
||||
label="Copy PID + SN"
|
||||
copiedLabel="Copied PID + SN"
|
||||
color="grape"
|
||||
copiedColor="violet"
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -9,9 +9,19 @@ interface CopyIconProps {
|
|||
copiedLabel?: string; // Tooltip khi đã copy, ví dụ: "Copied PID"
|
||||
ml?: number;
|
||||
mr?: number;
|
||||
color?: string; // màu khi chưa copy
|
||||
copiedColor?: string; // màu khi đã copy
|
||||
}
|
||||
|
||||
const CopyIcon = ({ value, label, copiedLabel, ml = 4, mr = 0 }: CopyIconProps) => {
|
||||
const CopyIcon = ({
|
||||
value,
|
||||
label,
|
||||
copiedLabel,
|
||||
ml = 4,
|
||||
mr = 0,
|
||||
color = "blue",
|
||||
copiedColor = "teal",
|
||||
}: CopyIconProps) => {
|
||||
const [copied, setCopied] = useState(false);
|
||||
|
||||
if (!value) return null;
|
||||
|
|
@ -31,7 +41,7 @@ const CopyIcon = ({ value, label, copiedLabel, ml = 4, mr = 0 }: CopyIconProps)
|
|||
<ActionIcon
|
||||
size="xs"
|
||||
variant={copied ? "filled" : "light"}
|
||||
color={copied ? "teal" : "blue"}
|
||||
color={copied ? copiedColor : color}
|
||||
onClick={handleClick}
|
||||
style={{ marginLeft: ml, marginRight: mr }}
|
||||
>
|
||||
|
|
|
|||
|
|
@ -547,6 +547,8 @@ const ModalTerminal = ({
|
|||
}
|
||||
label="Copy PID + SN"
|
||||
copiedLabel="Copied PID + SN"
|
||||
color="grape"
|
||||
copiedColor="violet"
|
||||
/>
|
||||
</Flex>
|
||||
<Flex mt="4px">
|
||||
|
|
|
|||
Loading…
Reference in New Issue