2022-10-23 01:39:02 +01:00
|
|
|
import { getAssetIDByName } from "@ui/assets";
|
|
|
|
|
import { showToast } from "@ui/toasts";
|
2022-10-19 07:58:32 +01:00
|
|
|
import { Forms } from "@ui/components";
|
2022-10-23 01:39:02 +01:00
|
|
|
import copyText from "@utils/copyText";
|
2022-10-18 23:59:45 +01:00
|
|
|
|
|
|
|
|
interface VersionProps {
|
|
|
|
|
label: string;
|
2022-10-23 01:39:02 +01:00
|
|
|
version: string;
|
|
|
|
|
icon: string;
|
2022-10-18 23:59:45 +01:00
|
|
|
}
|
|
|
|
|
|
2022-10-19 07:58:32 +01:00
|
|
|
const { FormRow, FormText } = Forms;
|
2022-10-18 23:59:45 +01:00
|
|
|
|
2022-10-23 01:39:02 +01:00
|
|
|
export default function Version({ label, version, icon }: VersionProps) {
|
2022-10-18 23:59:45 +01:00
|
|
|
return (
|
|
|
|
|
<FormRow
|
|
|
|
|
label={label}
|
2022-10-23 01:39:02 +01:00
|
|
|
leading={() => <FormRow.Icon source={getAssetIDByName(icon)} />}
|
2022-10-18 23:59:45 +01:00
|
|
|
trailing={() => <FormText>{version}</FormText>}
|
2022-10-23 01:39:02 +01:00
|
|
|
onPress={() => {
|
|
|
|
|
copyText(`${label} - ${version}`);
|
2022-10-28 18:50:40 +01:00
|
|
|
showToast("Copied version to clipboard.", getAssetIDByName("toast_copy_link"));
|
2022-10-23 01:39:02 +01:00
|
|
|
}}
|
2022-10-18 23:59:45 +01:00
|
|
|
/>
|
|
|
|
|
)
|
|
|
|
|
}
|