misc: Split post component into more components
This commit is contained in:
1 parent
58057bbeaa
commit
b0f3e01f5a
9 files changed
+183
-188
No files matched your search
@@ -1,14 +1,23 @@
|
||||
<script lang="ts">
|
||||
import { fly } from 'svelte/transition'
|
||||
type CardColor = 'default' | 'warning' | 'error'
|
||||
export let cardColor: CardColor = 'default'
|
||||
|
||||
const getColor = (color: CardColor) => {
|
||||
switch (color) {
|
||||
case 'default':
|
||||
return 'border border-slate-200 dark:border-zinc-800 dark:bg-zinc-900'
|
||||
case 'warning':
|
||||
return 'border border-yellow-300 bg-yellow-50'
|
||||
}
|
||||
}
|
||||
|
||||
let clazz = ''
|
||||
export { clazz as class }
|
||||
</script>
|
||||
|
||||
<div
|
||||
class="bg-white border border-slate-200
|
||||
dark:border-zinc-800 dark:bg-zinc-900 break-words
|
||||
p-1 rounded-xl {clazz}"
|
||||
class="bg-white break-words
|
||||
p-1 {getColor(cardColor)} rounded-xl {clazz}"
|
||||
>
|
||||
<slot />
|
||||
</div>
|
||||
Reference in new issue
Block a user