Files
speckle-server/packages/frontend-2/components/workspace/Card.vue
T
andrewwallacespeckle d262c28500 canMoveProjectToWorkspace
2025-04-11 23:04:40 +01:00

44 lines
1.1 KiB
Vue

<template>
<CommonCard
class="w-full border-outline-2 !p-4"
:class="{
'cursor-pointer hover:border-outline-3 shadow-sm hover:border-zinc-400 bg-foundation':
clickable
}"
@click="clickable && onClick"
>
<div class="flex justify-between gap-4">
<div class="flex gap-4">
<WorkspaceAvatar :name="name" :logo="logo" size="xl" />
<div class="flex flex-col sm:flex-row gap-4 justify-between flex-1">
<div class="flex flex-col items-start text-body-2xs text-foreground-2">
<h6 class="text-heading-sm text-foreground">{{ name }}</h6>
<slot name="text"></slot>
</div>
</div>
</div>
<div class="flex flex-col gap-y-2" @click.stop>
<slot name="actions"></slot>
</div>
</div>
</CommonCard>
</template>
<script setup lang="ts">
const props = defineProps<{
logo: string
name: string
clickable?: boolean
}>()
const emit = defineEmits<{
(e: 'click'): void
}>()
const onClick = () => {
if (props.clickable) {
emit('click')
}
}
</script>