<template>
	<div class="content">
		<div class="revs-header">
			<h2 class="heading">Revisions for "{{ actor.name }}"</h2>

			<div class="revs-actions">
				<a
					:href="`/actor/edit/${actor.id}/${actor.slug}`"
					class="link"
				>Edit actor</a>

				<a
					:href="`/actor/${actor.id}/${actor.slug}`"
					target="_blank"
					class="link"
				>Go to actor</a>
			</div>
		</div>

		<Revisions context="actor" />
	</div>
</template>

<script setup>
import { inject } from 'vue';

import Revisions from '#/components/edit/revisions.vue';

const pageContext = inject('pageContext');
const actor = pageContext.pageProps.actor;
</script>

<style scoped>
.content {
	padding: 1rem;
	flex-grow: 1;
}

.revs-header {
	display: flex;
	justify-content: space-between;
	align-items: center;

	.heading {
		line-height: 1.5;
	}
}

.revs-actions {
	display: flex;
	gap: 2rem;
	flex-shrink: 0;
}

@media(--compact) {
	.revs-header {
		display: flex;
		flex-direction: column;
		margin-bottom: 1rem;
	}
}
</style>