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}`}
|
value={`${line.inventory?.pid} ${line.inventory?.sn}`}
|
||||||
label="Copy PID + SN"
|
label="Copy PID + SN"
|
||||||
copiedLabel="Copied PID + SN"
|
copiedLabel="Copied PID + SN"
|
||||||
|
color="grape"
|
||||||
|
copiedColor="violet"
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -9,9 +9,19 @@ interface CopyIconProps {
|
||||||
copiedLabel?: string; // Tooltip khi đã copy, ví dụ: "Copied PID"
|
copiedLabel?: string; // Tooltip khi đã copy, ví dụ: "Copied PID"
|
||||||
ml?: number;
|
ml?: number;
|
||||||
mr?: 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);
|
const [copied, setCopied] = useState(false);
|
||||||
|
|
||||||
if (!value) return null;
|
if (!value) return null;
|
||||||
|
|
@ -31,7 +41,7 @@ const CopyIcon = ({ value, label, copiedLabel, ml = 4, mr = 0 }: CopyIconProps)
|
||||||
<ActionIcon
|
<ActionIcon
|
||||||
size="xs"
|
size="xs"
|
||||||
variant={copied ? "filled" : "light"}
|
variant={copied ? "filled" : "light"}
|
||||||
color={copied ? "teal" : "blue"}
|
color={copied ? copiedColor : color}
|
||||||
onClick={handleClick}
|
onClick={handleClick}
|
||||||
style={{ marginLeft: ml, marginRight: mr }}
|
style={{ marginLeft: ml, marginRight: mr }}
|
||||||
>
|
>
|
||||||
|
|
|
||||||
|
|
@ -547,6 +547,8 @@ const ModalTerminal = ({
|
||||||
}
|
}
|
||||||
label="Copy PID + SN"
|
label="Copy PID + SN"
|
||||||
copiedLabel="Copied PID + SN"
|
copiedLabel="Copied PID + SN"
|
||||||
|
color="grape"
|
||||||
|
copiedColor="violet"
|
||||||
/>
|
/>
|
||||||
</Flex>
|
</Flex>
|
||||||
<Flex mt="4px">
|
<Flex mt="4px">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue