Skip to content

Commit

Permalink
make <script> svelte 5
Browse files Browse the repository at this point in the history
  • Loading branch information
Phumsirii committed Dec 26, 2024
1 parent a917a72 commit 22840fb
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions packages/ui/src/components/molecule/comment/comment.svelte
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
<script>
import { ThumbsUp, ThumbsDown, Star } from 'lucide-svelte'

Check failure on line 2 in packages/ui/src/components/molecule/comment/comment.svelte

View workflow job for this annotation

GitHub Actions / lint (ubuntu-latest) / run

Run autofix to sort these imports!
export let content
export let semester
export let rating
export let likesCount
export let dislikesCount
let { content, semester, rating, likesCount, dislikesCount } = $props()
// Calculate the number of filled and unfilled stars
const totalStars = 5
const filledStars = Math.floor(rating) // Number of fully filled stars
const hasHalfStar = rating % 1 !== 0 // Determine if there's a half star
const emptyStars = totalStars - filledStars - (hasHalfStar ? 1 : 0)
let filledStars = $derived(Math.floor(rating)) // Number of fully filled stars
let hasHalfStar = $derived(rating % 1 !== 0) // Determine if there's a half star
let emptyStars = $derived(totalStars - filledStars - (hasHalfStar ? 1 : 0))
</script>

<div
Expand Down

0 comments on commit 22840fb

Please sign in to comment.