GoonCord/src/core/ui/components/AssetDisplay.tsx
amsyarasyiq 8c8baaed5c Numbers of improvements
Mostltly refactorings, does not affect user experience
2024-03-07 09:09:31 +08:00

20 lines
666 B
TypeScript

import { Asset } from "@lib/api/assets";
import { FormRow } from "@lib/ui/components/discord/Forms";
import { clipboard } from "@metro/common";
import { showToast } from "@ui/toasts";
import { Image } from "react-native";
interface AssetDisplayProps { asset: Asset; }
export default function AssetDisplay({ asset }: AssetDisplayProps) {
return (
<FormRow
label={`${asset.name} - ${asset.id}`}
trailing={<Image source={asset.id} style={{ width: 32, height: 32 }} />}
onPress={() => {
clipboard.setString(asset.name);
showToast.showCopyToClipboard();
}}
/>
);
}