feat: build Onyx SSR shell and plan hero with mock data
This commit is contained in:
1 parent
84c20992f9
commit
2db494fb10
34 files changed
+3197
-2
No files matched your search
@@ -0,0 +1,25 @@
|
||||
<script setup lang="ts">
|
||||
import { iconCloud, iconSunny } from '@sit-onyx/icons'
|
||||
import type { DailyWeather } from '#shared/insights'
|
||||
import { formatShortDate, formatWeekdayShort } from '~/utils/format'
|
||||
|
||||
const props = defineProps<{
|
||||
days: DailyWeather[]
|
||||
}>()
|
||||
|
||||
function iconFor(kind: DailyWeather['kind']) {
|
||||
return kind === 'sunny' || kind === 'partly-cloudy' ? iconSunny : iconCloud
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="weather-strip" role="list" aria-label="Weather forecast for the plan week">
|
||||
<div v-for="day in props.days" :key="day.date" class="weather-day" role="listitem">
|
||||
<strong>{{ formatWeekdayShort(day.date) }} {{ formatShortDate(day.date) }}</strong>
|
||||
<OnyxIcon :icon="iconFor(day.kind)" size="24px" color="primary" />
|
||||
<span>{{ Math.round(day.tempMin) }}–{{ Math.round(day.tempMax) }} °C</span>
|
||||
<span class="muted">{{ day.precipMm.toFixed(1) }} mm</span>
|
||||
<span class="muted">{{ Math.round(day.cloudPct) }}% cloud</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
Reference in new issue
Block a user