2023-03-20 16:11:27 -04:00
|
|
|
import { clipboard } from "@metro/common";
|
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-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}
|
2023-01-14 02:41:28 +00:00
|
|
|
leading={<FormRow.Icon source={getAssetIDByName(icon)} />}
|
|
|
|
|
trailing={<FormText>{version}</FormText>}
|
2022-10-23 01:39:02 +01:00
|
|
|
onPress={() => {
|
2023-03-20 16:11:27 -04:00
|
|
|
clipboard.setString(`${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
|
|
|
/>
|
|
|
|
|
)
|
|
|
|
|
}
|