Sharkey/src/client/components/ui/info.vue
2021-04-13 12:43:19 +09:00

60 lines
977 B
Vue

<template>
<div class="fpezltsf" :class="{ warn }">
<i v-if="warn"><Fa :icon="faExclamationTriangle"/></i>
<i v-else><Fa :icon="faInfoCircle"/></i>
<slot></slot>
</div>
</template>
<script lang="ts">
import { defineComponent } from 'vue';
import { faInfoCircle, faExclamationTriangle } from '@fortawesome/free-solid-svg-icons';
import * as os from '@client/os';
export default defineComponent({
props: {
warn: {
type: Boolean,
required: false,
default: false
},
},
data() {
return {
faInfoCircle, faExclamationTriangle
};
}
});
</script>
<style lang="scss" scoped>
.fpezltsf {
margin: 16px 0;
padding: 16px;
font-size: 90%;
background: var(--infoBg);
color: var(--infoFg);
border-radius: var(--radius);
&.warn {
background: var(--infoWarnBg);
color: var(--infoWarnFg);
}
&:first-child {
margin-top: 0;
}
&:last-child {
margin-bottom: 0;
}
> i {
margin-right: 4px;
}
}
._flat_ .fpezltsf {
border-radius: 0;
}
</style>