owltide/components/DiffScheduleLocation.vue

33 lines
692 B
Vue
Raw Normal View History

<!--
SPDX-FileCopyrightText: © 2025 Hornwitser <code@hornwitser.no>
SPDX-License-Identifier: AGPL-3.0-or-later
-->
<template>
<div>
<h4>{{ state }} {{ location.name }}</h4>
<DiffFieldString
title="Name"
:before="location.serverName"
:after="location.name"
:state
/>
<DiffFieldString
title="Description"
:before="location.serverDescription"
:after="location.description"
:state
/>
</div>
</template>
<script lang="ts" setup>
const props = defineProps<{
location: ClientScheduleLocation,
}>();
const state = computed(() => {
if (props.location.deleted) return "deleted";
if (props.location.isNew()) return "created";
return "modified";
});
</script>