2021-07-05 06:23:23 -04:00
|
|
|
import { LinkExternal } from "@styled-icons/boxicons-regular";
|
2021-06-20 17:09:18 -04:00
|
|
|
import { EmbedImage } from "revolt.js/dist/api/objects";
|
|
|
|
|
2021-07-05 06:23:23 -04:00
|
|
|
import styles from "./Embed.module.scss";
|
|
|
|
|
|
|
|
import IconButton from "../../../ui/IconButton";
|
|
|
|
|
2021-06-20 17:09:18 -04:00
|
|
|
interface Props {
|
2021-07-05 06:23:23 -04:00
|
|
|
embed: EmbedImage;
|
2021-06-20 17:09:18 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
export default function EmbedMediaActions({ embed }: Props) {
|
2021-07-05 06:23:23 -04:00
|
|
|
const filename = embed.url.split("/").pop();
|
2021-06-20 17:09:18 -04:00
|
|
|
|
2021-07-05 06:23:23 -04:00
|
|
|
return (
|
|
|
|
<div className={styles.actions}>
|
|
|
|
<div className={styles.info}>
|
|
|
|
<span className={styles.filename}>{filename}</span>
|
|
|
|
<span className={styles.filesize}>
|
|
|
|
{embed.width + "x" + embed.height}
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
<a href={embed.url} target="_blank">
|
|
|
|
<IconButton>
|
|
|
|
<LinkExternal size={24} />
|
|
|
|
</IconButton>
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
);
|
2021-06-20 17:09:18 -04:00
|
|
|
}
|