GoonCord/src/ui/settings/components/Version.tsx

26 lines
771 B
TypeScript
Raw Normal View History

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";
interface VersionProps {
label: string;
2022-10-23 01:39:02 +01:00
version: string;
icon: string;
}
2022-10-19 07:58:32 +01:00
const { FormRow, FormText } = Forms;
2022-10-23 01:39:02 +01:00
export default function Version({ label, version, icon }: VersionProps) {
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={() => {
clipboard.setString(`${label} - ${version}`);
showToast("Copied version to clipboard.", getAssetIDByName("toast_copy_link"));
2022-10-23 01:39:02 +01:00
}}
/>
)
}